From d610db0d1f360e8b79d33eac5dabaf93649323ce Mon Sep 17 00:00:00 2001 From: +++ Date: Sun, 22 Nov 2020 22:35:27 +0100 Subject: [PATCH] fix bug in api file replace strings with boolean and integer --- source/server/apistatusd.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/server/apistatusd.py b/source/server/apistatusd.py index 2f97f1b..04ad48c 100755 --- a/source/server/apistatusd.py +++ b/source/server/apistatusd.py @@ -155,11 +155,11 @@ def set_values(raw_data): param 1: byte return: tuple ''' - status = "true" if raw_data == b'\x01' else "false" - timestamp = str(time()).split('.')[0] + status = True if raw_data == b'\x01' else False + timestamp = int(str(time()).split('.')[0]) logging.debug('Set values for timestamp: {} and status: {}'.format( - timestamp, status)) + str(timestamp), str(status))) return (status, timestamp) @@ -235,7 +235,7 @@ def main(): logging.debug('Socket created') mySocket.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1) keep = mySocket.getsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE) - logging.debug('Socket keepalive: {}'format(keep)) + logging.debug('Socket keepalive: {}'.format(keep)) try: mySocket.bind((config['server']['host'], int(config['server']['port']))) mySocket.listen(5)