added device name as configuration

This commit is contained in:
2026-04-17 01:48:50 +05:30
parent 7b5c4d6600
commit 7122ea7aaa
2 changed files with 4 additions and 1 deletions

View File

@@ -6,9 +6,10 @@ from dotenv import load_dotenv
load_dotenv()
ntfy_token = os.environ['NTFY_Token']
device_name = os.environ['device_name']
shutdown_timer = 10
with serial.Serial('COM10', 115200, timeout=1) as ser:
with serial.Serial(device_name, 115200, timeout=1) as ser:
inverter_offline_counter = 0
while True:
if ser.readline().decode().strip() == "0":