File tree 1 file changed +7
-6
lines changed
custom_components/localtuya/core/pytuya
1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -1059,12 +1059,13 @@ async def status(self, cid=None):
1059
1059
"""Return device status."""
1060
1060
status : dict = await self .exchange (command = DP_QUERY , nodeID = cid , delay = False )
1061
1061
1062
- if status :
1063
- if cid and "dps" in status :
1064
- self .dps_cache .update ({cid : status ["dps" ]})
1065
- elif "dps" in status :
1066
- self .dps_cache .update ({"parent" : status ["dps" ]})
1067
-
1062
+ self .dps_cache .setdefault ("parent" , {})
1063
+ if status and "dps" in status :
1064
+ if "cid" in status :
1065
+ self .error (f"Yes found status: requested is { cid } and status cid is: { status ["cid" ]} " )
1066
+ self .dps_cache .update ({status ["cid" ]: status ["dps" ]})
1067
+ else :
1068
+ self .dps_cache ["parent" ].update (status ["dps" ])
1068
1069
return self .dps_cache .get (cid , {}) if cid else self .dps_cache .get ("parent" , {})
1069
1070
1070
1071
async def heartbeat (self ):
You can’t perform that action at this time.
0 commit comments