feat(fridge): expose discrete cooler temperature setpoint (#186)

RT42DG6630B1FZ is a single-door "cooler only" fridge that reports its
setpoint on /temperature/definite/cooler/vs/0 -- a vendor resource outside
both TEMP_CURRENT_GENERIC's '/temperature/current/' and TEMP_SETPOINT's
'/temperature/desired/' href prefixes, so it was entirely unbound and the
setting stayed app-only. Its supportedList (1/2/3/4/7 °C) isn't a
contiguous range, so this is modeled as a select over the device's own
live options rather than a NumberDesc that would let a user pick an
unsupported value like 5 or 6.
This commit is contained in:
Marc Billow committed 2026-07-29 13:11:07 +00:00
1 parent 74f34b91a5
commit b5c5c056f4
8 files changed
+540

No files matched your search

@@ -25,6 +25,7 @@ REGISTRY = DeviceRegistry(
fridge.DEFROST_DELAY,
fridge.DEFROST_DELAY_NATIVE_DUPLICATE,
fridge.DEFROST_BLOCK_STATUS,
fridge.DEFINITE_TEMPERATURE_COOLER,
fridge.DOORS_FALLBACK,
fridge.TEMPERATURES_FALLBACK,
fridge.ICEMAKER_STATUS_FALLBACK,
@@ -108,6 +108,37 @@ TEMP_SETPOINT = Capability(
),
)
# ---------------------------------------------------------------------------
# Discrete cooler setpoint (issue #186) -- some single-door ("cooler only")
# fridges report no /temperature/current|desired/* pair at all (this href
# doesn't match TEMP_CURRENT_GENERIC/TEMP_SETPOINT's '/temperature/current/'
# or '/temperature/desired/' prefixes), only this one vendor resource that
# bundles the live desired value together with the *specific* values the
# unit accepts. That supportedList (e.g. ['1','2','3','4','7'] on the issue
# #186 dump) is not a contiguous range -- 5 and 6 genuinely aren't valid
# setpoints on this model -- so a NumberDesc with a min/max/step would let a
# user pick an unsupported value; modeled as a select reading its own live
# options list instead, same shape as BEVERAGE_ZONE/PANTRY_ZONE above.
# ---------------------------------------------------------------------------
def _definite_cooler_write(p, rep, href=None):
return (['temperature', 'definite', 'cooler', 'vs', '0'],
{'x.com.samsung.da.definite.desired': p})
DEFINITE_TEMPERATURE_COOLER = Capability(
href='/temperature/definite/cooler/vs/0',
poll_tier='warm',
entities=(
SelectDesc(key='cooler_temperature_setpoint',
field='x.com.samsung.da.definite.desired',
icon='mdi:thermometer',
entity_category='config',
options_field='x.com.samsung.da.definite.supportedList',
write_fn=_definite_cooler_write),
),
)
# ---------------------------------------------------------------------------
# Icemaker nighttime quiet mode
# ---------------------------------------------------------------------------
@@ -214,6 +214,16 @@
"100": "High"
}
},
"cooler_temperature_setpoint": {
"name": "Cooler temperature",
"state": {
"1": "1 °C",
"2": "2 °C",
"3": "3 °C",
"4": "4 °C",
"7": "7 °C"
}
},
"day_brightness": {
"name": "Cabinet brightness",
"state": {
@@ -214,6 +214,16 @@
"100": "Hoog"
}
},
"cooler_temperature_setpoint": {
"name": "Koeler temperatuur",
"state": {
"1": "1 °C",
"2": "2 °C",
"3": "3 °C",
"4": "4 °C",
"7": "7 °C"
}
},
"day_brightness": {
"name": "Helderheid kast",
"state": {