Fix missing length on context id column with MariaDB
spotted by @dcoder42
The migration still worked as intented but the blob should have been
a bit smaller.
This only affects dev so there is no need for a backport
* Only publish mqtt_statestream when ha is started
* also catch startup states and use event filter
* Add check for MQTT to be available first
* Make sure MQTT is available and started
* Fix test
* Improve test
* Reset mock before assertung not called
Handle cancelation in wait_for_ble_connections_free
If `wait_for_ble_connections_free` was canceled due to timeout or
the esp disconnecting from Home Assistant the future would get
canceled. When we reconnect and get the next callback we need
to handle it being done.
fixes
```
2023-03-21 02:34:36.876 ERROR (MainThread) [homeassistant] Error doing job: Fatal error: protocol.data_received() call failed.
Traceback (most recent call last):
File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 868, in _read_ready__data_received
self._protocol.data_received(data)
File "/usr/local/lib/python3.10/site-packages/aioesphomeapi/_frame_helper.py", line 195, in data_received
self._callback_packet(msg_type_int, bytes(packet_data))
File "/usr/local/lib/python3.10/site-packages/aioesphomeapi/_frame_helper.py", line 110, in _callback_packet
self._on_pkt(Packet(type_, data))
File "/usr/local/lib/python3.10/site-packages/aioesphomeapi/connection.py", line 688, in _process_packet
handler(msg)
File "/usr/local/lib/python3.10/site-packages/aioesphomeapi/client.py", line 482, in on_msg
on_bluetooth_connections_free_update(resp.free, resp.limit)
File "/usr/src/homeassistant/homeassistant/components/esphome/entry_data.py", line 136, in async_update_ble_connection_limits
fut.set_result(free)
asyncio.exceptions.InvalidStateError: invalid state
```
* Adds base code for matter lock
* Adds basic matter door lock support
* Adds matter lock fixture
* Adds tests for matter lock
* Addresses feedback
* Added logic to handle inter states of matter lock
* Addesses feedback
* Introduce a delay between update entity calls
* Update homeassistant/components/zwave_js/update.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* move delay to constant and patch
* rename constant
* Switch to async_call_later
* Remove failing test
* Reimplement to solve task problem
* comment
* pass count directly so that value doesn't mutate before we store it
* lines
* Fix logic and tests
* Comments
* Readd missed coverage
* Add test for delays
* cleanup
* Fix async_added_to_hass logic
* flip conditional
* Store firmware info in extra data so we can restore it along with latest version
* Comment
* comment
* Add test for is_running check and fix bugs
* comment
* Add tests for various restore state scenarios
* move comment so it's less confusing
* improve typing
* consolidate into constant and remove unused one
* Update update.py
* update test to unknown state during partial restore
* fix elif check
* Fix type
* clean up test docstrings and function names
---------
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>