Added suport to get door sensor state

Tested working on
Firmware Version : Ver 6.60-3181-03 Jun  2 2015
Platform         : ZEM560
This commit is contained in:
icarome 2020-04-06 23:14:27 -03:00 committed by GitHub
parent 241244bb10
commit 8f19e2e8a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -696,6 +696,17 @@ class ZK(object):
return True return True
else: else:
raise ZKErrorResponse("Can't open door") 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): def __str__(self):
""" """