test
All checks were successful
Deploy powerbar.ti Frontend Portal / Deploy-Tinance2-Frontend-Portal-Production (push) Successful in 37s

This commit is contained in:
Matthew Frost 2024-02-07 16:44:32 +01:00
parent bcb97819f1
commit 63e957a5a6
2 changed files with 11 additions and 10 deletions

View file

@ -24,6 +24,7 @@ def run_telnet_command(powerbar, command):
for _ in range(retries):
try:
check_input_error(tn)
tn = get_telnet_connection(powerbar)
tn.write(f"{command}\r\n".encode('ascii'))
tn.close()

View file

@ -220,8 +220,8 @@ def powebar_group_action(group, action):
print(f"Turning {action} powerbar {powerbar} outlet {outlets}")
if powerbars[powerbar]['method'] == "telnet":
command = run_telnet_command(powerbar,f"{action} {outlets}")
if command:
for outlet in device['outlets']:
if outlet in powerbars[powerbar]['outlets']: