core/homeassistant/components/esphome
J. Nick Koston 0303618705
Handle cancelation of wait_for_ble_connections_free in esphome bluetooth (#90014)
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
```
2023-03-20 23:49:59 -04:00
..
bluetooth Bump bluetooth deps for bleak 0.20 (#89925) 2023-03-20 12:06:15 +01:00
__init__.py Filter out duplicate updates in esphome state dispatch (#89779) 2023-03-20 20:04:46 +01:00
binary_sensor.py Use try_parse_enum in integrations (#87085) 2023-02-02 12:34:01 +01:00
button.py Use try_parse_enum in integrations (#87085) 2023-02-02 12:34:01 +01:00
camera.py
climate.py Add esphome climate quiet fan mode (#74303) 2023-02-21 11:09:41 -06:00
config_flow.py ESPHome handle remove password and no encryption (#86995) 2023-01-30 23:05:48 -05:00
const.py
cover.py Use try_parse_enum in integrations (#87085) 2023-02-02 12:34:01 +01:00
dashboard.py Guard what version we can install ESPHome updates with (#87059) 2023-01-31 23:15:23 -05:00
diagnostics.py
domain_data.py Add Self typing (1) [mypy 1.0] (#87598) 2023-02-06 22:29:47 -06:00
entry_data.py Handle cancelation of wait_for_ble_connections_free in esphome bluetooth (#90014) 2023-03-20 23:49:59 -04:00
fan.py
light.py
lock.py
manifest.json Bump aioesphomeapi to 13.5.1 (#89777) 2023-03-15 20:00:47 -10:00
media_player.py
number.py Use try_parse_enum in integrations (#87085) 2023-02-02 12:34:01 +01:00
select.py
sensor.py Use try_parse_enum in integrations (#87085) 2023-02-02 12:34:01 +01:00
services.yaml
strings.json Add issue to ESPHome deprecating api password (#86606) 2023-01-25 11:07:57 +01:00
switch.py Use try_parse_enum in integrations (#87085) 2023-02-02 12:34:01 +01:00
update.py Mark ESPHome update entity unavailable when device is offline (#87576) 2023-02-07 22:15:54 +01:00