Skip to content

Commit

Permalink
Allow protocol versions 26 and 27 (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
emontnemery committed Sep 27, 2023
1 parent c5f0d3e commit 8b07d02
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion py_dormakaba_dkey/dkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@

ACTIVATION_CODE_ALLOWED = "BCDFGHJKLMNPQRSTVWXZ0123456789"

SUPPORTED_PROTOCOL_VERSIONS = (26, 27)


def device_filter(advertisement_data: AdvertisementData) -> bool:
"""Return True if the device is supported."""
Expand Down Expand Up @@ -936,7 +938,7 @@ def on_disconnect_req(self) -> None:

def on_identification(self, identification: cmds.GetIdentificationRsp) -> None:
"""Handle identification from the lock."""
if identification.protocol_version != 27:
if identification.protocol_version not in SUPPORTED_PROTOCOL_VERSIONS:
raise UnsupportedProtocolVersion(identification.protocol_version)
self.device_info.sw_version = identification.sw_version
self.device_info.device_id = f"{identification.key_holder_id.hex()}"
Expand Down

0 comments on commit 8b07d02

Please sign in to comment.