Fix switchbot not accepting the first advertisement (#78610)
This commit is contained in:
parent
f7ef9eb91b
commit
b8ccf53799
2 changed files with 2 additions and 2 deletions
|
@ -110,7 +110,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||
)
|
||||
entry.async_on_unload(coordinator.async_start())
|
||||
if not await coordinator.async_wait_ready():
|
||||
raise ConfigEntryNotReady(f"Switchbot {sensor_type} with {address} not ready")
|
||||
raise ConfigEntryNotReady(f"{address} is not advertising state")
|
||||
|
||||
entry.async_on_unload(entry.add_update_listener(_async_update_listener))
|
||||
await hass.config_entries.async_forward_entry_setups(
|
||||
|
|
|
@ -73,7 +73,7 @@ class SwitchbotDataUpdateCoordinator(PassiveBluetoothDataUpdateCoordinator):
|
|||
if adv := switchbot.parse_advertisement_data(
|
||||
service_info.device, service_info.advertisement
|
||||
):
|
||||
if "modelName" in self.data:
|
||||
if "modelName" in adv.data:
|
||||
self._ready_event.set()
|
||||
_LOGGER.debug("%s: Switchbot data: %s", self.ble_device.address, self.data)
|
||||
if not self.device.advertisement_changed(adv):
|
||||
|
|
Loading…
Add table
Reference in a new issue