mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Device automation config error message improvements (#44656)
Refs #44654, #44655
This commit is contained in:
parent
e2964ca878
commit
da66a4e933
@ -417,7 +417,15 @@ async def async_validate_trigger_config(hass, config):
|
|||||||
or device.model not in REMOTES
|
or device.model not in REMOTES
|
||||||
or trigger not in REMOTES[device.model]
|
or trigger not in REMOTES[device.model]
|
||||||
):
|
):
|
||||||
raise InvalidDeviceAutomationConfig
|
if not device:
|
||||||
|
raise InvalidDeviceAutomationConfig(
|
||||||
|
f"deCONZ trigger {trigger} device with id "
|
||||||
|
f"{config[CONF_DEVICE_ID]} not found"
|
||||||
|
)
|
||||||
|
raise InvalidDeviceAutomationConfig(
|
||||||
|
f"deCONZ trigger {trigger} is not valid for device "
|
||||||
|
f"{device} ({config[CONF_DEVICE_ID]})"
|
||||||
|
)
|
||||||
|
|
||||||
return config
|
return config
|
||||||
|
|
||||||
|
@ -169,7 +169,10 @@ async def async_get_condition_capabilities(hass, config):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if not state or not unit_of_measurement:
|
if not state or not unit_of_measurement:
|
||||||
raise InvalidDeviceAutomationConfig
|
raise InvalidDeviceAutomationConfig(
|
||||||
|
"No state or unit of measurement found for "
|
||||||
|
f"condition entity {config[CONF_ENTITY_ID]}"
|
||||||
|
)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"extra_fields": vol.Schema(
|
"extra_fields": vol.Schema(
|
||||||
|
@ -168,7 +168,10 @@ async def async_get_trigger_capabilities(hass, config):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if not state or not unit_of_measurement:
|
if not state or not unit_of_measurement:
|
||||||
raise InvalidDeviceAutomationConfig
|
raise InvalidDeviceAutomationConfig(
|
||||||
|
"No state or unit of measurement found for "
|
||||||
|
f"trigger entity {config[CONF_ENTITY_ID]}"
|
||||||
|
)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"extra_fields": vol.Schema(
|
"extra_fields": vol.Schema(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user