handle blank serial data
This commit is contained in:
6
main.py
6
main.py
@@ -47,8 +47,10 @@ def main():
|
||||
shutdown_triggered = False
|
||||
while running:
|
||||
line = ser.readline().decode(errors="ignore").strip()
|
||||
|
||||
if line == "0":
|
||||
if line == "":
|
||||
logger.warning("No serial data")
|
||||
continue
|
||||
elif line == "0":
|
||||
logger.debug("Inverter Online")
|
||||
inverter_offline_counter = 0
|
||||
elif inverter_offline_counter >= shutdown_timer:
|
||||
|
||||
Reference in New Issue
Block a user