ignore empty inputs from serial (idk why this happens)
This commit is contained in:
parent
54509b0c12
commit
ea55ec786f
1 changed files with 5 additions and 3 deletions
|
@ -16,10 +16,12 @@ outfile = "epever-tracer.json"
|
|||
while 1:
|
||||
# ser.readline()
|
||||
Data = ser.readline().decode('ascii')
|
||||
print("Data: ")
|
||||
print(Data)
|
||||
outFile = open(outfile, "w")
|
||||
outFile.write(Data)
|
||||
outFile.close
|
||||
if len(Data) > 0:
|
||||
outFile = open(outfile, "w")
|
||||
outFile.write(Data)
|
||||
outFile.close
|
||||
|
||||
##while 1:
|
||||
## # { "command": "switch", "arg": "one", "state": "off", "ver":"1690931931"}
|
||||
|
|
Loading…
Reference in a new issue