From 0060521bb6b588901d95385883110f5423310b2f Mon Sep 17 00:00:00 2001 From: Ben Vezzani Date: Thu, 26 Oct 2023 15:11:57 -0400 Subject: [PATCH] adds support for Big+Quiet co2 sensor --- libdyson/dyson_purifier_big_quiet.py | 5 +++++ setup.cfg | 2 +- tests/test_purifier_big_quiet.py | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/libdyson/dyson_purifier_big_quiet.py b/libdyson/dyson_purifier_big_quiet.py index df86af8..4d9c889 100644 --- a/libdyson/dyson_purifier_big_quiet.py +++ b/libdyson/dyson_purifier_big_quiet.py @@ -62,6 +62,11 @@ def nitrogen_dioxide(self) -> float: """Return the index value for nitrogen.""" return self._get_environmental_field_value("noxl", divisor=10) + @property + def carbon_dioxide(self) -> Optional[int]: + """Return the PPM of carbon dioxide""" + return self._get_environmental_field_value("co2r") + def turn_on(self) -> None: """Turn on the device.""" self._set_configuration(fpwr="ON") diff --git a/setup.cfg b/setup.cfg index 5a4cdcf..bf24216 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = libdyson-neon -version = 1.2.0 +version = 1.3.0 author = The libdyson Working Group author_email = dotvezz@gmail.com license = MIT License diff --git a/tests/test_purifier_big_quiet.py b/tests/test_purifier_big_quiet.py index 8ef0278..5e4d40d 100644 --- a/tests/test_purifier_big_quiet.py +++ b/tests/test_purifier_big_quiet.py @@ -120,6 +120,7 @@ def test_properties(mqtt_client: MockedMQTT): "noxl": "0011", "p25r": "0010", "p10r": "0009", + "co2r": "0400", "sltm": "OFF", } } @@ -128,6 +129,7 @@ def test_properties(mqtt_client: MockedMQTT): assert device.particulate_matter_10 == 5 assert device.volatile_organic_compounds == 0.4 assert device.nitrogen_dioxide == 1.1 + assert device.carbon_dioxide == 400 @pytest.mark.parametrize(