From 7dd807502a95825429b9ec0a464f77097a8691a0 Mon Sep 17 00:00:00 2001 From: alsum Date: Tue, 17 Jul 2018 11:05:41 +0200 Subject: [PATCH] adding set-time func --- zk/base.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/zk/base.py b/zk/base.py index c5d642a..aba3645 100644 --- a/zk/base.py +++ b/zk/base.py @@ -514,3 +514,17 @@ class ZK(object): return True else: raise ZKErrorResponse("Invalid response") + + def set_time(self, time): + """Set the time on the machine""" + command = const.CMD_SET_TIME + command_string = '' + response_size = 8 + chksum = 0 + session_id = self.__sesion_id + reply_id = self.__reply_id + cmd_response = self.__send_command(command,command_string, chksum, session_id, reply_id, response_size) + if cmd_response.get('status'): + return True + else: + raise ZKErrorResponse("Invalid response") \ No newline at end of file