From 6170b69eb89a1f3bd4928b0c0df8670ff14bb495 Mon Sep 17 00:00:00 2001 From: xZetsubou Date: Mon, 16 Oct 2023 13:43:28 +0300 Subject: [PATCH] Hotfix for `3.3` devices `detect_available_dps` --- custom_components/localtuya/core/pytuya/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/localtuya/core/pytuya/__init__.py b/custom_components/localtuya/core/pytuya/__init__.py index 7ec8bf224..80d210237 100644 --- a/custom_components/localtuya/core/pytuya/__init__.py +++ b/custom_components/localtuya/core/pytuya/__init__.py @@ -1080,9 +1080,9 @@ async def detect_available_dps(self, cid=None): self.dps_cache.update({"parent": data["dps"]}) if self.dev_type == "type_0a": - return self.dps_cache + return self.dps_cache.get(cid) if cid else self.dps_cache.get("parent") self.dps_to_request = self.dps_cache - return self.dps_cache.get(cid) or self.dps_cache.get("parent") + return self.dps_cache.get(cid) if cid else self.dps_cache.get("parent") def add_dps_to_request(self, dp_indicies): """Add a datapoint (DP) to be included in requests."""