Skip to content

Commit

Permalink
Address review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
emontnemery authored and balloob committed Oct 26, 2023
1 parent 959bd7f commit 6e77af5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions homeassistant/components/device_automation/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,13 @@ async def async_validate_device_automation_config(
raise InvalidDeviceAutomationConfig(
f"Unknown device '{validated_config[CONF_DEVICE_ID]}'"
)
if entity := validated_config.get(CONF_ENTITY_ID):
if entity_id := validated_config.get(CONF_ENTITY_ID):
try:
er.async_validate_entity_id(er.async_get(hass), entity)
er.async_validate_entity_id(er.async_get(hass), entity_id)
except vol.Invalid as err:
raise InvalidDeviceAutomationConfig(f"Unknown entity '{entity}'") from err
raise InvalidDeviceAutomationConfig(
f"Unknown entity '{entity_id}'"
) from err

if not hasattr(platform, DYNAMIC_VALIDATOR[automation_type]):
# Pass the unvalidated config to avoid mutating the raw config twice
Expand Down

0 comments on commit 6e77af5

Please sign in to comment.