diff --git a/custom_components/dirigera_platform/base_classes.py b/custom_components/dirigera_platform/base_classes.py index 9a408b5..16c3ea4 100644 --- a/custom_components/dirigera_platform/base_classes.py +++ b/custom_components/dirigera_platform/base_classes.py @@ -22,7 +22,7 @@ UnitOfTemperature, CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, CONCENTRATION_PARTS_PER_MILLION, - LIGHT_LUX, + LIGHT_LUX ) from dirigera import Hub @@ -497,12 +497,11 @@ class ikea_alpstuga_co2(ikea_base_device_sensor, SensorEntity): def __init__(self, device: ikea_vindstyrka_device) -> None: logger.debug("ikea_alpstuga_co2 ctor...") super().__init__( - device, - id_suffix="CO2", + device, + id_suffix="CO2", name="CO2", device_class=SensorDeviceClass.CO2, - native_unit_of_measurement=CONCENTRATION_PARTS_PER_MILLION, - state_class="measurement") + native_unit_of_measurement=CONCENTRATION_PARTS_PER_MILLION) @property def native_value(self) -> int: diff --git a/custom_components/dirigera_platform/requirements.txt b/custom_components/dirigera_platform/requirements.txt index 35110d1..4e0e58e 100644 --- a/custom_components/dirigera_platform/requirements.txt +++ b/custom_components/dirigera_platform/requirements.txt @@ -1 +1 @@ -dirigera==1.2.1 +dirigera==1.2.6 diff --git a/custom_components/dirigera_platform/sensor.py b/custom_components/dirigera_platform/sensor.py index 9d79481..fb90ca7 100644 --- a/custom_components/dirigera_platform/sensor.py +++ b/custom_components/dirigera_platform/sensor.py @@ -107,6 +107,8 @@ async def add_environment_sensors(async_add_entities, env_devices): env_sensors.append(ikea_vindstyrka_pm25(env_device, WhichPM25.MIN)) if getattr(env_device,"voc_index", None) is not None: env_sensors.append(ikea_vindstyrka_voc_index(env_device)) + if getattr(env_device,"current_c_o2") is not None: + env_sensors.append(ikea_alpstuga_co2(env_device)) if getattr(env_device,"current_c_o2", None) is not None: env_sensors.append(ikea_alpstuga_co2(env_device))