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: