Device automation config error message improvements (#44656)

Refs #44654, #44655
This commit is contained in:
Ville Skyttä 2020-12-31 01:02:14 +02:00 committed by GitHub
parent e2964ca878
commit da66a4e933
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 3 deletions

View file

@ -168,7 +168,10 @@ async def async_get_trigger_capabilities(hass, config):
)
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 {
"extra_fields": vol.Schema(