Fix exception when last Shelly device is removed (#45476)
parent
80c2efa9f2
commit
5bc4db5ef9
|
@ -172,6 +172,9 @@ def get_input_triggers(
|
|||
|
||||
def get_device_wrapper(hass: HomeAssistant, device_id: str):
|
||||
"""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]:
|
||||
wrapper = hass.data[DOMAIN][DATA_CONFIG_ENTRY][config_entry][COAP]
|
||||
|
||||
|
|
Loading…
Reference in New Issue