forked from Krautspace/doorstatus
fix bug in api file
replace strings with boolean and integer
This commit is contained in:
parent
64937e7ea9
commit
d610db0d1f
1 changed files with 4 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue