Skip to content

Commit

Permalink
Fix auto configure if device added manually but in cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
xZetsubou committed Nov 11, 2023
1 parent 8a4a2e9 commit c0ce7ed
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions custom_components/localtuya/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def dps_string_list(dps_data: dict[str, dict], cloud_dp_codes: dict[str, dict])
strs = []

# Merge DPs that found through cloud with local.
# These DPs probably doesn't have local states, so we assume there functions are buttons.
# These DPs probably doesn't have local states, so we assume these functions are buttons.
for dp, func in cloud_dp_codes.items():
if dp not in dps_data and str(func.get("value")).lower() in ["false", "true"]:
dps_data[dp] = f"{func.get('value')}, tip: button entity"
Expand Down Expand Up @@ -725,7 +725,8 @@ async def async_step_configure_device(self, user_input=None):
if user_input is not None:
try:
self.device_data = user_input.copy()
self.nodeID = self.nodeID or user_input.get(CONF_NODE_ID, None)
self.selected_device: str = dev_id or user_input.get(CONF_DEVICE_ID)
self.nodeID: str = self.nodeID or user_input.get(CONF_NODE_ID, None)
if dev_id is not None:
cloud_devs = self.cloud_data.device_list
if dev_id in cloud_devs:
Expand Down

0 comments on commit c0ce7ed

Please sign in to comment.