Fix Yale Access Bluetooth not being available again after being unavailable (#81320)

pull/81365/head
J. Nick Koston 2022-10-31 20:21:40 -05:00 committed by GitHub
parent d87ca0b099
commit eea4719544
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 3 deletions

View File

@ -94,6 +94,19 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
entry.title, push_lock
)
@callback
def _async_device_unavailable(
_service_info: bluetooth.BluetoothServiceInfoBleak,
) -> None:
"""Handle device not longer being seen by the bluetooth stack."""
push_lock.reset_advertisement_state()
entry.async_on_unload(
bluetooth.async_track_unavailable(
hass, _async_device_unavailable, push_lock.address
)
)
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
entry.async_on_unload(entry.add_update_listener(_async_update_listener))
return True

View File

@ -3,7 +3,7 @@
"name": "Yale Access Bluetooth",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/yalexs_ble",
"requirements": ["yalexs-ble==1.9.4"],
"requirements": ["yalexs-ble==1.9.5"],
"dependencies": ["bluetooth"],
"codeowners": ["@bdraco"],
"bluetooth": [

View File

@ -2580,7 +2580,7 @@ xs1-api-client==3.0.0
yalesmartalarmclient==0.3.9
# homeassistant.components.yalexs_ble
yalexs-ble==1.9.4
yalexs-ble==1.9.5
# homeassistant.components.august
yalexs==1.2.6

View File

@ -1790,7 +1790,7 @@ xmltodict==0.13.0
yalesmartalarmclient==0.3.9
# homeassistant.components.yalexs_ble
yalexs-ble==1.9.4
yalexs-ble==1.9.5
# homeassistant.components.august
yalexs==1.2.6