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:
parent
241244bb10
commit
8f19e2e8a4
11
zk/base.py
11
zk/base.py
@ -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):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user