Model after_run_progress as a percentage, fix Dutch after-run-progress name
runningProgress's own field name states its domain, so restore unit='%' and state_class='measurement' rather than leaving it an opaque passthrough -- that hedge made sense for activationState (no supported-values list, no write contract to invent) but not here, where the name itself is the evidence. "Nadraaien voortgang" also wasn't idiomatic Dutch (nouns don't stack that way); "Voortgang nadraaien" matches how the rest of the catalog compounds these names.
This commit is contained in:
3 files changed
+9
-7
No files matched your search
@@ -188,11 +188,10 @@ HOOD_FILTER = Capability(
|
|||||||
# read-only (monitoring, not an invented "enable" write) per the 'don't
|
# read-only (monitoring, not an invented "enable" write) per the 'don't
|
||||||
# guess' rule; runningCancel's only observed value is the command name
|
# guess' rule; runningCancel's only observed value is the command name
|
||||||
# itself ('Cancel'), the same self-describing command-field shape as
|
# itself ('Cancel'), the same self-describing command-field shape as
|
||||||
# operational.STOP_BUTTON. runningProgress is left a bare passthrough for the
|
# operational.STOP_BUTTON. runningProgress's own name states its domain
|
||||||
# same 'don't guess' reason -- the only observed sample is "0", with no
|
# (a percentage of the cycle completed), so it's modeled as one rather than
|
||||||
# range or supported-values field to confirm it's a percentage rather than a
|
# left an opaque passthrough -- unlike activationState/runningCancel, there's
|
||||||
# minutes/seconds count, and unit + state_class='measurement' would commit
|
# no ambiguous field name or missing-write-contract question here to hedge on.
|
||||||
# it to long-term statistics under a possibly-wrong unit.
|
|
||||||
AFTER_RUN = Capability(
|
AFTER_RUN = Capability(
|
||||||
href='/afterrun/vs/0',
|
href='/afterrun/vs/0',
|
||||||
poll_tier='warm',
|
poll_tier='warm',
|
||||||
@@ -206,7 +205,10 @@ AFTER_RUN = Capability(
|
|||||||
SensorDesc(
|
SensorDesc(
|
||||||
key='after_run_progress',
|
key='after_run_progress',
|
||||||
field='x.com.samsung.da.runningProgress',
|
field='x.com.samsung.da.runningProgress',
|
||||||
|
unit='%',
|
||||||
|
state_class='measurement',
|
||||||
icon='mdi:fan-clock',
|
icon='mdi:fan-clock',
|
||||||
|
value_fn=int_or_none,
|
||||||
),
|
),
|
||||||
ButtonDesc(
|
ButtonDesc(
|
||||||
key='after_run_cancel',
|
key='after_run_cancel',
|
||||||
|
|||||||
@@ -536,7 +536,7 @@
|
|||||||
},
|
},
|
||||||
"sensor": {
|
"sensor": {
|
||||||
"after_run_progress": {
|
"after_run_progress": {
|
||||||
"name": "Nadraaien voortgang"
|
"name": "Voortgang nadraaien"
|
||||||
},
|
},
|
||||||
"air_filter_usage": {
|
"air_filter_usage": {
|
||||||
"name": "Filterverbruik"
|
"name": "Filterverbruik"
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ def test_range_hood_fixture_values():
|
|||||||
assert state['air_sensing_state'] == 'NonProcessing'
|
assert state['air_sensing_state'] == 'NonProcessing'
|
||||||
assert state['last_air_sensing_level'] == 'Kr2'
|
assert state['last_air_sensing_level'] == 'Kr2'
|
||||||
assert state['after_run_active'] is False
|
assert state['after_run_active'] is False
|
||||||
assert state['after_run_progress'] == '0'
|
assert state['after_run_progress'] == 0
|
||||||
|
|
||||||
|
|
||||||
def test_one_composite_fan_is_bound():
|
def test_one_composite_fan_is_bound():
|
||||||
|
|||||||
Reference in new issue
Block a user