J. Nick Koston 1 天之前
父節點
當前提交
b4db6b5ab2
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      switchbot/devices/lock.py

+ 6 - 0
switchbot/devices/lock.py

@@ -214,6 +214,12 @@ class SwitchbotLock(SwitchbotSequenceDevice, SwitchbotEncryptedDevice):
 
     def _notification_handler(self, _sender: int, data: bytearray) -> None:
         if self._notifications_enabled and self._check_command_result(data, 0, {0xF}):
+            if self._expected_disconnect:
+                _LOGGER.debug(
+                    "%s: Ignoring lock notification during expected disconnect",
+                    self.name,
+                )
+                return
             self._update_lock_status(data)
         else:
             super()._notification_handler(_sender, data)