mirror of
https://github.com/elisspace/core.git
synced 2026-09-30 06:19:55 +00:00
Handle case when device can be None (#29171)
This commit is contained in:
committed by
Paulus Schoutsen
parent
88441d5f68
commit
bdb3eb1683
@@ -299,7 +299,11 @@ async def async_validate_trigger_config(hass, config):
|
||||
|
||||
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
|
||||
|
||||
return config
|
||||
|
||||
Reference in New Issue
Block a user