Преглед изворни кода

TODO: persist and restore last_action/last_user across restarts

ZiB пре 4 месеци
родитељ
комит
3cad25a415
1 измењених фајлова са 4 додато и 0 уклоњено
  1. 4 0
      custom_components/zlock_slots/coordinator.py

+ 4 - 0
custom_components/zlock_slots/coordinator.py

@@ -84,6 +84,10 @@ class ZLockCoordinator(DataUpdateCoordinator[dict[str, LockState]]):
     stored = await self._store.async_load()
     if stored:
       self._names = stored.get("names", {})
+      # TODO: restore last_action/last_user for each lock and group from stored
+      # "last_events": {"lock_entity_id": {"last_action": ..., "last_user": ...}}
+      # Door state is unlikely to have changed since last run, so stale values
+      # are better than None until the next real event arrives.
 
     await self._async_fetch_all_slots()