fix(water_purifier): read favorite-temp options from showList (#196)
favorite_hotwater_temperature's options_field read favorite.supportedList, which is only the four fixed presets. The SmartThings app also lets the user add one custom value to their own display list via its "temperatures to display" editor (bounded by /setting/waterpurifier/vs/0's hotwaterRange), and that value shows up in favorite.showList but never in supportedList. A unit whose current default was that custom value rendered as HA's "unknown" state, since current_option wasn't among the (too-narrow) options list. showList is a superset of supportedList that always includes whatever the current default actually is. /setting/waterpurifier/vs/0's own hot_water_temperature select is untouched -- its write contract for values off the old preset list still isn't confirmed, so it stays gated off on boards that don't report supportedHotTemperatures.
This commit is contained in:
2 files changed
+41
-3
No files matched your search
@@ -175,11 +175,23 @@ FAVORITE_HOTWATER = Capability(
|
||||
write_fn=lambda p, rep, href=None: (
|
||||
['favorite', 'hotwater', 'vs', '0'],
|
||||
{'x.com.samsung.da.switchHotwater': 'Locked' if p == 'On' else 'Unlocked'})),
|
||||
# Issue #196: `supportedList` is only the four *fixed* presets
|
||||
# (e.g. ['40', '75', '85', '90']) -- the SmartThings app also lets
|
||||
# the user add one custom value to their own display list via its
|
||||
# "temperatures to display" editor (a wheel picker bounded by
|
||||
# /setting/waterpurifier/vs/0's hotwaterRange, separate resource),
|
||||
# and that custom value shows up in `showList`
|
||||
# (['40', '50', '75', '85', '90'] here) but never in
|
||||
# `supportedList`. Reading options from `supportedList` meant a
|
||||
# unit whose current default *was* that custom value rendered as
|
||||
# "unknown" -- not a coverage gap, just the wrong field. `showList`
|
||||
# is a superset of `supportedList` that always includes whatever
|
||||
# the current default actually is, custom or not.
|
||||
SelectDesc(key='favorite_hotwater_temperature',
|
||||
field='x.com.samsung.da.favorite.defaultTemperature',
|
||||
icon='mdi:thermometer',
|
||||
entity_category='config',
|
||||
options_field='x.com.samsung.da.favorite.supportedList',
|
||||
options_field='x.com.samsung.da.favorite.showList',
|
||||
write_fn=lambda p, rep, href=None: (
|
||||
['favorite', 'hotwater', 'vs', '0'],
|
||||
{'x.com.samsung.da.favorite.defaultTemperature': p})),
|
||||
|
||||
Reference in new issue
Block a user