Merge pull request #83 from icarome/patch-1

Added suport to get door sensor state
This commit is contained in:
kurenai-ryu 2020-04-06 22:23:16 -04:00 committed by GitHub
commit 90fb15a29d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -696,6 +696,17 @@ class ZK(object):
return True
else:
raise ZKErrorResponse("Can't open door")
def get_lock_state(self):
'''
:return: boolean
thanks to https://github.com/icarome/pyzk/
'''
command = const.CMD_DOORSTATE_RRQ
cmd_response = self.__send_command(command)
if cmd_response.get('status'):
return True
else:
return False
def __str__(self):
"""