Skip to content

Commit

Permalink
fix set dp service for sub devices
Browse files Browse the repository at this point in the history
  • Loading branch information
xZetsubou committed Jan 13, 2024
1 parent fe50c74 commit bee12d1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions custom_components/localtuya/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ async def _handle_set_dp(event: ServiceCall):
raise HomeAssistantError("unknown device id")

host = entry.data[CONF_DEVICES][dev_id].get(CONF_HOST)
if node_id := entry.data[CONF_DEVICES][dev_id].get(CONF_NODE_ID):
host = f"{host}_{node_id}"
device: TuyaDevice = hass.data[DOMAIN][entry.entry_id].devices[host]
if not device.connected:
raise HomeAssistantError("not connected to device")
Expand Down

0 comments on commit bee12d1

Please sign in to comment.