fix invalid read

This commit is contained in:
Nicolò Balzarotti 2023-01-05 13:27:31 +01:00
parent a0aaaef690
commit 175695d512
1 changed files with 1 additions and 1 deletions

View File

@ -41,7 +41,7 @@ class Temperature1W(Sensor):
return None return None
if content[0].strip()[-3:] != "YES": if content[0].strip()[-3:] != "YES":
print("INVALID CHECKSUM") print("INVALID CHECKSUM")
return None return (time, None)
return (time, int(re.search("t=([0-9]+)", content[1]).group(1)) / 1000.0) return (time, int(re.search("t=([0-9]+)", content[1]).group(1)) / 1000.0)
class Sensors(): class Sensors():