Browse Source

Fix missing await in SwitchbotRelaySwitch and SwitchbotLock verify_encryption_key (#279)

J. Nick Koston 3 months ago
parent
commit
22d421cecb
3 changed files with 4 additions and 2 deletions
  1. 2 0
      switchbot/__init__.py
  2. 1 1
      switchbot/devices/lock.py
  3. 1 1
      switchbot/devices/relay_switch.py

+ 2 - 0
switchbot/__init__.py

@@ -16,6 +16,7 @@ from .const import (
     SwitchbotAuthenticationError,
     SwitchbotModel,
 )
+from .devices.device import SwitchbotEncryptedDevice
 from .devices.base_light import SwitchbotBaseLight
 from .devices.blind_tilt import SwitchbotBlindTilt
 from .devices.bot import Switchbot
@@ -41,6 +42,7 @@ __all__ = [
     "SwitchbotAccountConnectionError",
     "SwitchbotApiError",
     "SwitchbotAuthenticationError",
+    "SwitchbotEncryptedDevice",
     "ColorMode",
     "LockStatus",
     "SwitchbotBaseLight",

+ 1 - 1
switchbot/devices/lock.py

@@ -71,7 +71,7 @@ class SwitchbotLock(SwitchbotEncryptedDevice):
         model: SwitchbotModel = SwitchbotModel.LOCK,
         **kwargs: Any,
     ) -> bool:
-        return super().verify_encryption_key(
+        return await super().verify_encryption_key(
             device, key_id, encryption_key, model, **kwargs
         )
 

+ 1 - 1
switchbot/devices/relay_switch.py

@@ -44,7 +44,7 @@ class SwitchbotRelaySwitch(SwitchbotEncryptedDevice):
         model: SwitchbotModel = SwitchbotModel.RELAY_SWITCH_1PM,
         **kwargs: Any,
     ) -> bool:
-        return super().verify_encryption_key(
+        return await super().verify_encryption_key(
             device, key_id, encryption_key, model, **kwargs
         )