Fixed co2 reading

This commit is contained in:
Maximilian Giller 2024-08-10 02:39:16 +02:00
parent cb50f230b6
commit d3b2cc4c89

View file

@ -13,9 +13,9 @@ class Mhz19Co2:
return self.last_read return self.last_read
def read(self) -> int | None: def read(self) -> int | None:
data: dict | None = mh_z19.read() data = mh_z19.read()
if not data or "co2" not in data.keys(): if not data:
return None return None
self.last_read = data["co2"] self.last_read = data["co2"]