|
@@ -113,20 +113,13 @@ class ZLockCoordinator(DataUpdateCoordinator[dict[str, LockState]]):
|
|
|
_LOGGER.exception("Failed to fetch code slots for %s", lock_entity_id)
|
|
_LOGGER.exception("Failed to fetch code slots for %s", lock_entity_id)
|
|
|
return {}
|
|
return {}
|
|
|
|
|
|
|
|
- if users:
|
|
|
|
|
- _LOGGER.debug("UserData[0]: %s", vars(users[0]) if hasattr(users[0], "__dict__") else users[0])
|
|
|
|
|
-
|
|
|
|
|
slots: dict[int, SlotInfo] = {}
|
|
slots: dict[int, SlotInfo] = {}
|
|
|
for user in users:
|
|
for user in users:
|
|
|
slot_num = user.user_id
|
|
slot_num = user.user_id
|
|
|
if slot_num == 0:
|
|
if slot_num == 0:
|
|
|
continue
|
|
continue
|
|
|
- status = user.user_id_status
|
|
|
|
|
- status_name = status.name if hasattr(status, "name") else str(status)
|
|
|
|
|
- if status_name == "Available":
|
|
|
|
|
- continue
|
|
|
|
|
slots[slot_num] = SlotInfo(
|
|
slots[slot_num] = SlotInfo(
|
|
|
- status=status_name.lower(),
|
|
|
|
|
|
|
+ status="enabled" if user.active else "disabled",
|
|
|
name=self.get_name(lock_entity_id, slot_num),
|
|
name=self.get_name(lock_entity_id, slot_num),
|
|
|
)
|
|
)
|
|
|
return slots
|
|
return slots
|