File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 55import logging
66from typing import Any
77
8+ from bleak .backends .device import BLEDevice
89from cryptography .hazmat .primitives .ciphers import Cipher , algorithms , modes
910
1011from ..const import LockStatus
11- from ..models import SwitchBotAdvertisement
1212from .device import SwitchbotDevice
1313
1414COMMAND_HEADER = "57"
@@ -31,7 +31,7 @@ class SwitchbotLock(SwitchbotDevice):
3131
3232 def __init__ (
3333 self ,
34- advertisement : SwitchBotAdvertisement ,
34+ device : BLEDevice ,
3535 key_id : str ,
3636 encryption_key : str ,
3737 interface : int = 0 ,
@@ -50,8 +50,7 @@ def __init__(
5050 self ._key_id = key_id
5151 self ._encryption_key = bytearray .fromhex (encryption_key )
5252 self ._notifications_enabled : bool = False
53- super ().__init__ (advertisement .device , None , interface , ** kwargs )
54- self .update_from_advertisement (advertisement )
53+ super ().__init__ (device , None , interface , ** kwargs )
5554
5655 async def lock (self ) -> bool :
5756 """Send lock command."""
You can’t perform that action at this time.
0 commit comments