From d3b2cc4c891a7e321d1d8acf51e780235d953da0 Mon Sep 17 00:00:00 2001 From: Maximilian Giller Date: Sat, 10 Aug 2024 02:39:16 +0200 Subject: [PATCH] Fixed co2 reading --- src/handler/mhz19_co2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/handler/mhz19_co2.py b/src/handler/mhz19_co2.py index 5240780..925308b 100644 --- a/src/handler/mhz19_co2.py +++ b/src/handler/mhz19_co2.py @@ -13,9 +13,9 @@ class Mhz19Co2: return self.last_read 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 self.last_read = data["co2"]