diff --git a/custom_components/healthbox/const.py b/custom_components/healthbox/const.py index cdbd630..25753a2 100644 --- a/custom_components/healthbox/const.py +++ b/custom_components/healthbox/const.py @@ -122,6 +122,19 @@ def indoor_aqi(self) -> Decimal | None: except IndexError: aqi = None return aqi + @property + def indoor_voc_ppm(self) -> Decimal | None: + """HB Indoor Volatile Organic Compounds.""" + voc_ppm = None + try: + voc_ppm = [ + sensor["parameter"]["voc"]["value"] + for sensor in self.sensors_data + if "voc" in sensor["parameter"] + ][0] + except IndexError: + voc_ppm = None + return voc_ppm class HealthboxDataObject: diff --git a/custom_components/healthbox/sensor.py b/custom_components/healthbox/sensor.py index 98e3552..a6b4da0 100644 --- a/custom_components/healthbox/sensor.py +++ b/custom_components/healthbox/sensor.py @@ -198,7 +198,6 @@ def generate_room_sensors_for_healthbox( ) return room_sensors - def generate_global_sensors_for_healthbox( coordinator: HealthboxDataUpdateCoordinator, ) -> list[HealthboxGlobalSensorEntityDescription]: