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