mirror of
https://github.com/home-assistant/core.git
synced 2025-08-06 22:25:13 +02:00
Fix exception when last Shelly device is removed (#45476)
This commit is contained in:
@@ -172,6 +172,9 @@ def get_input_triggers(
|
|||||||
|
|
||||||
def get_device_wrapper(hass: HomeAssistant, device_id: str):
|
def get_device_wrapper(hass: HomeAssistant, device_id: str):
|
||||||
"""Get a Shelly device wrapper for the given device id."""
|
"""Get a Shelly device wrapper for the given device id."""
|
||||||
|
if not hass.data.get(DOMAIN):
|
||||||
|
return None
|
||||||
|
|
||||||
for config_entry in hass.data[DOMAIN][DATA_CONFIG_ENTRY]:
|
for config_entry in hass.data[DOMAIN][DATA_CONFIG_ENTRY]:
|
||||||
wrapper = hass.data[DOMAIN][DATA_CONFIG_ENTRY][config_entry][COAP]
|
wrapper = hass.data[DOMAIN][DATA_CONFIG_ENTRY][config_entry][COAP]
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user