Map remaining coverage-gap hrefs, fix discover() false-gap bug, improve device naming

Maps the fridge/dishwasher hrefs flagged by last session's coverage-gap
Repairs issue: defrost delay (switch) + block status (diagnostic binary
sensor), master ice-maker enable, self-check trigger/status, dishwasher
diagnosis trigger/status, and last-operation-source. Adds fallback
capabilities for /doors, /temperatures, and /icemaker/status that only
bind when the richer per-instance hrefs they duplicate are absent, so
simpler devices without those hrefs still get the data. Everything else
in the original gap list moves to capabilities.ignored (Bixby audio
feedback, inert DR/energy-planner resources, redundant metadata).

Fixes discover() reporting a known href as an unregistered gap whenever
its match_fn declined to bind for that device (e.g. a filter capability
on hardware without that filter) — it's now only a gap when no capability
is registered for the href at all.

Device naming now uses x.com.samsung.da.modelNum (not the OCF /oic/p,d
metadata, which produced inconsistent names like "[dishwasher] Samsung")
to build "Samsung <Type> (<model>)".
This commit is contained in:
Marc Billow committed 2026-07-08 15:24:34 -05:00
1 parent d2699f0f5b
commit 5d1a32aa9a
13 files changed
+279 -23

No files matched your search

+20
View File
@@ -138,6 +138,26 @@ def test_discover_match_fn_filters_wrong_device():
assert bound == []
def test_discover_match_fn_decline_is_not_logged_as_gap():
"""A registered href whose match_fn declines is known, not a gap.
Distinguishes "no capability registered for this href" (a real
coverage gap) from "a capability is registered but chose not to bind
for this device" (e.g. a filter capability on hardware that doesn't
have that filter) — only the former should be reported via `log`.
"""
seen = []
cap = Capability(
href='/filter/vs/0',
match_fn=lambda rep, resources: False,
entities=(BinarySensorDesc(key='filter', field='x.com.samsung.da.filterStatus'),),
)
resources = {'/filter/vs/0': {'x.com.samsung.da.filterStatus': 'notused'}}
bound = discover(resources, {'/filter/vs/0': [cap]}, log=seen.append)
assert bound == []
assert seen == []
def test_discover_rt_filter_gates_binding():
"""Cap with rt_filter must not bind a rep whose rt list does not match."""
oven_mode_cap = Capability(