mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 23:27:37 +00:00
Fix init for first added shelly device (#48411)
This commit is contained in:
parent
aa0292974a
commit
309c3a8d82
@ -75,7 +75,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
|
|||||||
dev_reg = await device_registry.async_get_registry(hass)
|
dev_reg = await device_registry.async_get_registry(hass)
|
||||||
identifier = (DOMAIN, entry.unique_id)
|
identifier = (DOMAIN, entry.unique_id)
|
||||||
device_entry = dev_reg.async_get_device(identifiers={identifier}, connections=set())
|
device_entry = dev_reg.async_get_device(identifiers={identifier}, connections=set())
|
||||||
if entry.entry_id not in device_entry.config_entries:
|
if device_entry and entry.entry_id not in device_entry.config_entries:
|
||||||
device_entry = None
|
device_entry = None
|
||||||
|
|
||||||
sleep_period = entry.data.get("sleep_period")
|
sleep_period = entry.data.get("sleep_period")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user