mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Handle case when device can be None (#29171)
This commit is contained in:
parent
88441d5f68
commit
bdb3eb1683
@ -299,7 +299,11 @@ async def async_validate_trigger_config(hass, config):
|
|||||||
|
|
||||||
trigger = (config[CONF_TYPE], config[CONF_SUBTYPE])
|
trigger = (config[CONF_TYPE], config[CONF_SUBTYPE])
|
||||||
|
|
||||||
if device.model not in REMOTES or trigger not in REMOTES[device.model]:
|
if (
|
||||||
|
not device
|
||||||
|
or device.model not in REMOTES
|
||||||
|
or trigger not in REMOTES[device.model]
|
||||||
|
):
|
||||||
raise InvalidDeviceAutomationConfig
|
raise InvalidDeviceAutomationConfig
|
||||||
|
|
||||||
return config
|
return config
|
||||||
|
Loading…
x
Reference in New Issue
Block a user