telnet
All checks were successful
Deploy powerbar.ti Frontend Portal / Deploy-Tinance2-Frontend-Portal-Production (push) Successful in 7s
All checks were successful
Deploy powerbar.ti Frontend Portal / Deploy-Tinance2-Frontend-Portal-Production (push) Successful in 7s
This commit is contained in:
parent
113cefbe82
commit
9c5ad472c7
1 changed files with 1 additions and 2 deletions
|
@ -166,7 +166,6 @@ def powebar_group_action(group, action):
|
||||||
|
|
||||||
if action in ['on', 'off']:
|
if action in ['on', 'off']:
|
||||||
try:
|
try:
|
||||||
|
|
||||||
for device in group["devices"]:
|
for device in group["devices"]:
|
||||||
powerbar = device["powerbar"]
|
powerbar = device["powerbar"]
|
||||||
tn = telnetlib.Telnet(powerbars[powerbar]['host'], powerbars[powerbar]['port'])
|
tn = telnetlib.Telnet(powerbars[powerbar]['host'], powerbars[powerbar]['port'])
|
||||||
|
@ -175,7 +174,7 @@ def powebar_group_action(group, action):
|
||||||
print(f"Turning {action} powerbar {powerbar} outlet {outlets}")
|
print(f"Turning {action} powerbar {powerbar} outlet {outlets}")
|
||||||
tn.write(f"{action} {outlets}\r\n".encode('ascii'))
|
tn.write(f"{action} {outlets}\r\n".encode('ascii'))
|
||||||
tn.close()
|
tn.close()
|
||||||
for outlet in outlets:
|
for outlet in powerbars[powerbar]['outlets']:
|
||||||
powerbars[powerbar]['outlets'][outlet]['state'] = action
|
powerbars[powerbar]['outlets'][outlet]['state'] = action
|
||||||
print(f"Turned {action} powerbar {powerbar} outlet {outlet}")
|
print(f"Turned {action} powerbar {powerbar} outlet {outlet}")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue