Stop collapsing a genuine fivepercentHumidity=0 reading to unknown (#160)
#146's zero-as-"not measuring" carve-out was meant for ARTIK051 boards' plain x.com.samsung.da.humidity field, which only populates while Air monitoring is briefly on and zeroes out afterward. It was accidentally applied to fivepercentHumidity too, which every other AC board relies on and which has never been documented getting stuck at zero -- so a real 0% reading on those boards silently became "unknown". Only the humidity fallback field now collapses 0; fivepercentHumidity passes 0 through as a real reading.
This commit is contained in:
2 files changed
+24
-7
No files matched your search
@@ -415,3 +415,14 @@ def test_humidity_falls_back_to_the_plain_field_where_five_percent_is_absent():
|
||||
assert desc.rep_fn({'x.com.samsung.da.humidity': '51'}) == 51.0
|
||||
assert desc.rep_fn({'x.com.samsung.da.humidity': '0'}) is None
|
||||
assert desc.rep_fn({}) is None
|
||||
|
||||
|
||||
def test_humidity_five_percent_field_passes_a_genuine_zero_through():
|
||||
"""issue #160: fivepercentHumidity's zero-as-"not measuring" carve-out
|
||||
(added in #146 to cover ARTIK051's plain humidity field) was
|
||||
over-applied to fivepercentHumidity too, silently turning a real 0%
|
||||
reading on every other AC board into unknown. Only the humidity
|
||||
fallback field collapses 0 -- fivepercentHumidity's 0 is a real
|
||||
reading."""
|
||||
desc = airconditioner.HUMIDITY.entities[0]
|
||||
assert desc.rep_fn({'x.com.samsung.da.fivepercentHumidity': '0'}) == 0.0
|
||||
Reference in new issue
Block a user