Merge pull request #83 from icarome/patch-1
Added suport to get door sensor state
This commit is contained in:
commit
90fb15a29d
11
zk/base.py
11
zk/base.py
@ -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):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user