Skip to content

Commit

Permalink
Fixes unit scales for NO2 and VOC (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
dotvezz authored May 4, 2023
1 parent d01e46d commit 5fbf97e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions libdyson/dyson_pure_cool.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ def particulate_matter_10(self):
return int(self._get_environmental_field_value("pm10"))

@property
def volatile_organic_compounds(self):
"""Return VOCs in micro grams per cubic meter."""
return int(self._get_environmental_field_value("va10"))
def volatile_organic_compounds(self) -> float:
"""Return the index value for VOC"""
return self._get_environmental_field_value("va10", divisor=10)

@property
def nitrogen_dioxide(self):
"""Return nitrogen dioxide level in micro grams per cubic meter."""
return int(self._get_environmental_field_value("noxl"))
def nitrogen_dioxide(self) -> float:
"""Return the index value for nitrogen."""
return self._get_environmental_field_value("noxl", divisor=10)

def turn_on(self) -> None:
"""Turn on the device."""
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = libdyson-neon
version = 1.0.0
version = 1.0.1
author = The libdyson Working Group
author_email = [email protected]
license = MIT License
Expand Down
4 changes: 2 additions & 2 deletions tests/test_pure_cool.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ def test_properties(mqtt_client: MockedMQTT):
device.request_environmental_data()
assert device.particulate_matter_2_5 == 9
assert device.particulate_matter_10 == 5
assert device.volatile_organic_compounds == 4
assert device.nitrogen_dioxide == 11
assert device.volatile_organic_compounds == 0.4
assert device.nitrogen_dioxide == 1.1


@pytest.mark.parametrize(
Expand Down

0 comments on commit 5fbf97e

Please sign in to comment.