更新删除设备

This commit is contained in:
不求圣剑
2026-02-04 10:54:52 +08:00
parent b21efb63f8
commit d80a2b0fa3

View File

@@ -394,20 +394,19 @@ class JackeryDataCoordinator:
item = {**item, "devType": 2}
combined.append(item)
if combined:
for item in combined:
if not isinstance(item, dict):
continue
dt = item.get("devType")
if dt == 2:
current_cts.append(item)
else:
current_plugs.append(item)
for item in combined:
if not isinstance(item, dict):
continue
dt = item.get("devType")
if dt == 2:
current_cts.append(item)
else:
current_plugs.append(item)
self._data_cache["cts"] = current_cts
# Store all in "plugs" for JackeryPlugSensor to find itself by SN
self._data_cache["plugs"] = combined
self._data_cache["plug"] = combined # Keep original key too
self._data_cache["cts"] = current_cts
# Store all in "plugs" for JackeryPlugSensor to find itself by SN
self._data_cache["plugs"] = combined
self._data_cache["plug"] = combined # Keep original key too
# Type 25 or Status: Main device data
elif isinstance(body, dict):