From e396ea027631c004f0b87dc8036862678d7aed37 Mon Sep 17 00:00:00 2001 From: Bartlomiej Kobus Date: Tue, 9 Jun 2026 11:01:19 +0200 Subject: [PATCH] feat: add support for CO2Sensor --- blebox_uniapi/box_types.py | 2 ++ blebox_uniapi/sensor.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/blebox_uniapi/box_types.py b/blebox_uniapi/box_types.py index 3727251..3cd06ab 100644 --- a/blebox_uniapi/box_types.py +++ b/blebox_uniapi/box_types.py @@ -729,6 +729,8 @@ def get_latest_api_level(product_type: str) -> Union[dict, int]: "wind": lambda x: f"multiSensor.sensors[?id == `{x}`]|[?type == 'wind']|[0]|value", "humidity": lambda x: f"multiSensor.sensors[?id == `{x}`]|[?type == 'humidity']|[0]|value", "openStatus": lambda x: f"multiSensor.sensors[?id == `{x}`]|[?type == 'openStatus']|[0]|value", + "co2": lambda x: f"multiSensor.sensors[?id == `{x}`]|[?type == 'co2']|[0]|value", + "co2Definition": lambda x: f"multiSensor.sensors[?id == `{x}`]|[?type == 'co2Definition']|[0]|value", }, ] ], diff --git a/blebox_uniapi/sensor.py b/blebox_uniapi/sensor.py index d21ad61..9d396d5 100644 --- a/blebox_uniapi/sensor.py +++ b/blebox_uniapi/sensor.py @@ -166,6 +166,8 @@ def __str__(self): @SensorFactory.register("humidity", unit="percentage", scale=100) @SensorFactory.register("wind", unit="m/s", scale=10) @SensorFactory.register("openStatus", unit="") +@SensorFactory.register("co2", unit="ppm") +@SensorFactory.register("co2Definition", unit="") class GenericSensor(BaseSensor): def __init__( # base sensor params