Procházet zdrojové kódy

Add debug logging to zlock checkin/checkout calls

ZiB před 4 měsíci
rodič
revize
42f569b546
1 změnil soubory, kde provedl 5 přidání a 0 odebrání
  1. 5 0
      custom_components/room_cal_ha/coordinator.py

+ 5 - 0
custom_components/room_cal_ha/coordinator.py

@@ -249,16 +249,19 @@ class RoomCalCoordinator(DataUpdateCoordinator[CoordinatorData]):
   async def _async_push_lock_codes(self, code: str) -> None:
     slot = self.entry.options.get(CONF_ZWAVE_SLOT)
     lock_entity_ids = self._zlock_entity_ids()
+    _LOGGER.debug("push_lock_codes: slot=%s locks=%s", slot, lock_entity_ids)
     if not lock_entity_ids or slot is None:
       return
     slot = int(slot)
     for entity_id in lock_entity_ids:
       try:
+        _LOGGER.debug("zlock set_code: %s slot %s", entity_id, slot)
         await self.hass.services.async_call(
           "zlock_slots", "set_code",
           {"lock_entity_id": entity_id, "slot": slot, "code": code},
           blocking=True,
         )
+        _LOGGER.debug("zlock set_slot_enabled True: %s slot %s", entity_id, slot)
         await self.hass.services.async_call(
           "zlock_slots", "set_slot_enabled",
           {"lock_entity_id": entity_id, "slot": slot, "enabled": True},
@@ -270,11 +273,13 @@ class RoomCalCoordinator(DataUpdateCoordinator[CoordinatorData]):
   async def _async_clear_lock_codes(self) -> None:
     slot = self.entry.options.get(CONF_ZWAVE_SLOT)
     lock_entity_ids = self._zlock_entity_ids()
+    _LOGGER.debug("clear_lock_codes: slot=%s locks=%s", slot, lock_entity_ids)
     if not lock_entity_ids or slot is None:
       return
     slot = int(slot)
     for entity_id in lock_entity_ids:
       try:
+        _LOGGER.debug("zlock set_slot_enabled False: %s slot %s", entity_id, slot)
         await self.hass.services.async_call(
           "zlock_slots", "set_slot_enabled",
           {"lock_entity_id": entity_id, "slot": slot, "enabled": False},