Skip to content

Commit

Permalink
Merge pull request #1130 from Necroneco/formaldehyde
Browse files Browse the repository at this point in the history
Fix formaldehyde scale
  • Loading branch information
AlexxIT authored Sep 20, 2023
2 parents 593cfc0 + 3022109 commit c69f085
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def decode(self, device: "XDevice", payload: dict, value: dict):
payload["opening"] = bool(data[0] == 0)

elif eid == 0x1010 and len(data) == 2: # 4112
payload["formaldehyde"] = int.from_bytes(data, "little") / 100.0
payload["formaldehyde"] = int.from_bytes(data, "little") / 1000.0

elif eid == 0x1012 and len(data) == 1: # 4114
# hass: On means open, Off means closed
Expand Down
1 change: 1 addition & 0 deletions custom_components/xiaomi_gateway3/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def new_entity(gateway: XGateway, device: XDevice, conv: Converter) -> XEntity:
"distance": LENGTH_METERS,
"occupancy_duration": TIME_SECONDS,
"occupancy_distance": LENGTH_METERS,
"formaldehyde": CONCENTRATION_MILLIGRAMS_PER_CUBIC_METER,
# "link_quality": "lqi",
# "rssi": "dBm",
# "msg_received": "msg",
Expand Down

0 comments on commit c69f085

Please sign in to comment.