added more env config options

This commit is contained in:
2026-04-17 02:18:53 +05:30
parent a20174bcf3
commit 9eb504cc8f
2 changed files with 8 additions and 3 deletions

View File

@@ -6,7 +6,10 @@ import logging
##########################################
#Logging
loglevel = logging.DEBUG
if os.environ['logging_level'] == "DEBUG":
loglevel = logging.DEBUG
elif os.environ['logging_level'] == "INFO":
loglevel = logging.INFO
logger = logging.getLogger('Power Monitor')
logger.setLevel(loglevel)
#Console Handler
@@ -23,7 +26,7 @@ load_dotenv()
ntfy_token = os.environ['NTFY_Token']
device_name = os.environ['device_name']
shutdown_timer = 30
shutdown_timer = int(os.environ['shutdown_timer'])
with serial.Serial(device_name, 115200, timeout=1) as ser:
inverter_offline_counter = 0