add ssh client close

This commit is contained in:
crate 2024-10-12 03:24:28 -05:00
parent accb805db6
commit 3269abe626

View File

@ -123,6 +123,7 @@ def shutdown_nas():
stdin, stdout, stderr = client.exec_command('sudo shutdown')
for line in stdout:
print(line.strip())
client.close()
except Exception as e:
logger.error(e)
@ -148,7 +149,7 @@ def pwr_online(battery):
logger.info(message)
send_email(f"{ups_id}: Power On Line", message)
send_discord(message)
if ups_id == "Server" and battery > 90:
if ups_id == "Server" and battery > 75:
wake_up(battery)
def pwr_offline(battery):