small fix
This commit is contained in:
23
main.py
23
main.py
@@ -192,17 +192,18 @@ loadconfig()
|
|||||||
|
|
||||||
def hpiapp(function='status'):
|
def hpiapp(function='status'):
|
||||||
if function == 'status':
|
if function == 'status':
|
||||||
if not sio_remote.connected:
|
if hpiatstart == '1':
|
||||||
try:
|
if not sio_remote.connected:
|
||||||
logging.info("Trying to reconnect...")
|
try:
|
||||||
sio_remote.connect(SERVER_URL, headers=custom_headers, wait_timeout=10)
|
logging.info("Trying to reconnect...")
|
||||||
except Exception as e:
|
sio_remote.connect(SERVER_URL, headers=custom_headers, wait_timeout=10)
|
||||||
logging.error(f"Reconnect failed: {e}")
|
except Exception as e:
|
||||||
else:
|
logging.error(f"Reconnect failed: {e}")
|
||||||
try:
|
else:
|
||||||
sio_remote.emit("heartbeat", {"token": TOKEN})
|
try:
|
||||||
except Exception as e:
|
sio_remote.emit("heartbeat", {"token": TOKEN})
|
||||||
logging.warning(f"Emit failed: {e}")
|
except Exception as e:
|
||||||
|
logging.warning(f"Emit failed: {e}")
|
||||||
|
|
||||||
status=sio_remote.sid
|
status=sio_remote.sid
|
||||||
ischanged('hpiconn', status)
|
ischanged('hpiconn', status)
|
||||||
|
|||||||
@@ -1082,9 +1082,9 @@ $(document).ready(function() {
|
|||||||
$("#hpicontrol")[0].classList.remove('disabled')
|
$("#hpicontrol")[0].classList.remove('disabled')
|
||||||
$("#hpicontrol")[0].classList.add('btn-outline-success')
|
$("#hpicontrol")[0].classList.add('btn-outline-success')
|
||||||
$("#hpicontrol").text('Connect')
|
$("#hpicontrol").text('Connect')
|
||||||
if (!$('#hpikey').val()) {
|
//if (!$('#hpikey').val()) {
|
||||||
$("#hpicontrol")[0].classList.add('disabled')
|
// $("#hpicontrol")[0].classList.add('disabled')
|
||||||
}
|
//}
|
||||||
break;
|
break;
|
||||||
case false:
|
case false:
|
||||||
removeClassesByPrefix('#hpistatus', 'text-')
|
removeClassesByPrefix('#hpistatus', 'text-')
|
||||||
|
|||||||
Reference in New Issue
Block a user