Skip to content

Commit

Permalink
Use the hchr field for Formaldehyde values
Browse files Browse the repository at this point in the history
Reference discussion link: libdyson-wg/ha-dyson#4

The `hcho` field in MQTT is of an unknown unit/scale and has no known
conversion factor to a known unit. However, it was recently discovered
that `hchr` (referred to as "High Res Formaldehyde" in the android app)
has a clean conversion factor of n/1000 to mg/m^3.
  • Loading branch information
dotvezz committed Jul 6, 2023
1 parent 4229ce3 commit 7344136
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libdyson/cloud/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import requests
from requests.auth import AuthBase, HTTPBasicAuth

from libdyson.exceptions import (
from ..exceptions import (
DysonAuthRequired,
DysonInvalidAccountStatus,
DysonInvalidAuth,
Expand Down
2 changes: 1 addition & 1 deletion libdyson/dyson_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def warning_code(self) -> str:
@property
def formaldehyde(self) -> Optional[int]:
"""Return formaldehyde reading."""
val = self._get_environmental_field_value("hcho")
val = self._get_environmental_field_value("hchr", divisor=1000)
if val is None:
return None

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.2
version = 1.1.0
author = The libdyson Working Group
author_email = [email protected]
license = MIT License
Expand Down

0 comments on commit 7344136

Please sign in to comment.