From 45a0b72266d1b8ae3d9901346b9f4513c2932b10 Mon Sep 17 00:00:00 2001 From: Matthew Frost <m.frost@mattronix.nl> Date: Sun, 19 Nov 2023 01:16:41 +0100 Subject: [PATCH] dumb me --- app/views.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/views.py b/app/views.py index 3504925..12fd94b 100644 --- a/app/views.py +++ b/app/views.py @@ -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"