Skip to content

Commit d625734

Browse files
committed
fix: adjust HCHO value conversion to only apply for values greater than 1
1 parent a0acbc2 commit d625734

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

custom_components/treeow/sensor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def _update_value(self):
5959
_LOGGER.debug(f'Sensor [{self._attr_unique_id}] temperature/humidity value {value} adjusted to {processed_value}')
6060

6161
# Handle HCHO (formaldehyde) values - API returns integer (e.g. 35), convert to mg/m³ (0.035)
62-
if self._is_hcho and isinstance(processed_value, (int, float)):
62+
if self._is_hcho and isinstance(processed_value, (int, float)) and processed_value > 1:
6363
processed_value = processed_value / 1000
6464
_LOGGER.debug(f'Sensor [{self._attr_unique_id}] HCHO value {value} converted to {processed_value} mg/m³')
6565

0 commit comments

Comments
 (0)