Skip to content

Commit

Permalink
fix: device functions doesn't have dp_id #73
Browse files Browse the repository at this point in the history
  • Loading branch information
xZetsubou authored Nov 26, 2023
1 parent e857d8b commit 969b60b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/localtuya/cloud_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ async def get_device_functions(self, device_id) -> dict[str, dict]:
if query_props[1] == "ok":
device_data = {str(p["dp_id"]): p for p in query_props[0].get("properties")}
if specs[1] == "ok":
for func in specs[0].get("functions"):
if str(func["dp_id"]) in device_data:
for func in specs[0].get("functions", {}):
if str(func.get("dp_id")) in device_data:
device_data[str(func["dp_id"])].update(func)

if device_data:
Expand Down

0 comments on commit 969b60b

Please sign in to comment.