Skip to content

Commit

Permalink
set_dp service: check if entry is not none.
Browse files Browse the repository at this point in the history
xZetsubou authored Nov 4, 2023
1 parent 92311a1 commit 1a7a078
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/localtuya/__init__.py
Original file line number Diff line number Diff line change
@@ -87,7 +87,7 @@ async def _handle_set_dp(event: Event):
"""Handle set_dp service call."""
dev_id = event.data[CONF_DEVICE_ID]
entry: ConfigEntry = async_config_entry_by_device_id(hass, dev_id)
if entry and not entry.entry_id:
if not entry or not entry.entry_id:
raise HomeAssistantError("unknown device id")

host = entry.data[CONF_DEVICES][dev_id].get(CONF_HOST)

0 comments on commit 1a7a078

Please sign in to comment.