From d649cbfb1825ca1126ac3c42003cd9ca9395f291 Mon Sep 17 00:00:00 2001 From: Matthew Frost Date: Sat, 2 Dec 2023 16:55:51 +0100 Subject: [PATCH] better logic --- app/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views.py b/app/views.py index 033840f..8e9fc51 100644 --- a/app/views.py +++ b/app/views.py @@ -4,7 +4,6 @@ from flask import jsonify import telnetlib import time - routes = Blueprint('routes', __name__) # Create a dictionary to store the active telnet connections @@ -32,6 +31,7 @@ def get_telnet_connection(powerbar): def run_telnet_command(powerbar, command): try: + tn = get_telnet_connection(powerbar) tn.write(f"{command}\r\n".encode('ascii')) return except Exception as e: