diff --git a/.github/workflows/Static Analysis.yaml b/.github/workflows/Static Analysis.yaml index 30bdd5c..60ff7b4 100644 --- a/.github/workflows/Static Analysis.yaml +++ b/.github/workflows/Static Analysis.yaml @@ -37,6 +37,7 @@ jobs: - name: Install pylint run: | pip install pylint + pip install -r requierements.txt - name: Checkout code uses: actions/checkout@v2 - name: Run pylint diff --git a/main.py b/main.py index 9b2b905..da32b86 100644 --- a/main.py +++ b/main.py @@ -6,7 +6,6 @@ import os import socket import sys -import time import pidfile # Desktop Credentials @@ -32,9 +31,9 @@ logger.error('Sleep on LAN Script already running, Aborting!') sys.exit(-1) -error_count = 0 +ERROR_COUNT = 0 while True: - if error_count > MAX_ERRORS: + if ERROR_COUNT > MAX_ERRORS: logger.error(f'Sleep on LAN Script reached max error count {MAX_ERRORS}') logger.error("System Exiting") sys.exit(-2) @@ -47,7 +46,7 @@ sock.bind((HOST, PORT)) logger.info(f"Binded on port {PORT}") logger.info(f"Attempting to listen on port {PORT}") - error_count = 0 + ERROR_COUNT = 0 sock.listen() logger.info("Listening on Port 60000") conn, addr = sock.accept() @@ -74,5 +73,5 @@ except Exception as e: logger.error(e) logger.warning("Python code has reached end of script, the code will no logner talk to Node-Red") - logger.info(f"Attempting to restart loop! Error Number: {error_count}") - error_count = error_count+1 + logger.info(f"Attempting to restart loop! Error Number: {ERROR_COUNT}") + ERROR_COUNT = ERROR_COUNT+1