From 8f19e2e8a4e6f197e40ebfc6f57e2422cb273dcd Mon Sep 17 00:00:00 2001 From: icarome Date: Mon, 6 Apr 2020 23:14:27 -0300 Subject: [PATCH] Added suport to get door sensor state Tested working on Firmware Version : Ver 6.60-3181-03 Jun 2 2015 Platform : ZEM560 --- zk/base.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/zk/base.py b/zk/base.py index 9c27de5..0544b82 100644 --- a/zk/base.py +++ b/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): """