dumb me
This commit is contained in:
parent
169894dfc3
commit
45a0b72266
1 changed files with 1 additions and 3 deletions
|
@ -45,7 +45,6 @@ def powerbar_control(powerbar, outlet, action):
|
|||
abort(404)
|
||||
|
||||
if action == 'on':
|
||||
# Telnet to powerbar and send command
|
||||
try:
|
||||
print(f"Turning on powerbar {powerbar} outlet {outlet}")
|
||||
tn = telnetlib.Telnet(powerbars[powerbar]['host'], powerbars[powerbar]['port'])
|
||||
|
@ -55,10 +54,8 @@ def powerbar_control(powerbar, outlet, action):
|
|||
except Exception as e:
|
||||
print(f"Telnet error: {e}")
|
||||
abort(500)
|
||||
return "200"
|
||||
|
||||
if action == 'off':
|
||||
# Telnet to powerbar and send command
|
||||
try:
|
||||
print(f"Turning off powerbar {powerbar} outlet {outlet}")
|
||||
tn = telnetlib.Telnet(powerbars[powerbar]['host'], powerbars[powerbar]['port'])
|
||||
|
@ -68,5 +65,6 @@ def powerbar_control(powerbar, outlet, action):
|
|||
except Exception as e:
|
||||
print(f"Telnet error: {e}")
|
||||
abort(500)
|
||||
|
||||
return "200"
|
||||
|
||||
|
|
Loading…
Reference in a new issue