更新删除设备
This commit is contained in:
@@ -394,20 +394,19 @@ class JackeryDataCoordinator:
|
|||||||
item = {**item, "devType": 2}
|
item = {**item, "devType": 2}
|
||||||
combined.append(item)
|
combined.append(item)
|
||||||
|
|
||||||
if combined:
|
for item in combined:
|
||||||
for item in combined:
|
if not isinstance(item, dict):
|
||||||
if not isinstance(item, dict):
|
continue
|
||||||
continue
|
dt = item.get("devType")
|
||||||
dt = item.get("devType")
|
if dt == 2:
|
||||||
if dt == 2:
|
current_cts.append(item)
|
||||||
current_cts.append(item)
|
else:
|
||||||
else:
|
current_plugs.append(item)
|
||||||
current_plugs.append(item)
|
|
||||||
|
|
||||||
self._data_cache["cts"] = current_cts
|
self._data_cache["cts"] = current_cts
|
||||||
# Store all in "plugs" for JackeryPlugSensor to find itself by SN
|
# Store all in "plugs" for JackeryPlugSensor to find itself by SN
|
||||||
self._data_cache["plugs"] = combined
|
self._data_cache["plugs"] = combined
|
||||||
self._data_cache["plug"] = combined # Keep original key too
|
self._data_cache["plug"] = combined # Keep original key too
|
||||||
|
|
||||||
# Type 25 or Status: Main device data
|
# Type 25 or Status: Main device data
|
||||||
elif isinstance(body, dict):
|
elif isinstance(body, dict):
|
||||||
|
|||||||
Reference in New Issue
Block a user