Close stale switchbot connections at setup time (#78202)

pull/78205/head
J. Nick Koston 2022-09-10 13:21:10 -05:00 committed by GitHub
parent f19af72895
commit a3ec28ea79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 3 deletions

View File

@ -89,6 +89,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
raise ConfigEntryNotReady(
f"Could not find Switchbot {sensor_type} with address {address}"
)
await switchbot.close_stale_connections(ble_device)
cls = CLASS_BY_DEVICE.get(sensor_type, switchbot.SwitchbotDevice)
device = cls(
device=ble_device,

View File

@ -2,7 +2,7 @@
"domain": "switchbot",
"name": "SwitchBot",
"documentation": "https://www.home-assistant.io/integrations/switchbot",
"requirements": ["PySwitchbot==0.19.2"],
"requirements": ["PySwitchbot==0.19.3"],
"config_flow": true,
"dependencies": ["bluetooth"],
"codeowners": [

View File

@ -37,7 +37,7 @@ PyRMVtransport==0.3.3
PySocks==1.7.1
# homeassistant.components.switchbot
PySwitchbot==0.19.2
PySwitchbot==0.19.3
# homeassistant.components.transport_nsw
PyTransportNSW==0.1.1

View File

@ -33,7 +33,7 @@ PyRMVtransport==0.3.3
PySocks==1.7.1
# homeassistant.components.switchbot
PySwitchbot==0.19.2
PySwitchbot==0.19.3
# homeassistant.components.transport_nsw
PyTransportNSW==0.1.1