fridge: fold the three Auto Door Open variant hrefs into one pattern cap (issue #328)

AUTO_DOOR_SINGLE/KIMCHI/WINECELLAR were identical one-line no-entity
Capability declarations differing only by href. Replaced with
AUTO_DOOR_VARIANT, a pattern cap keyed on href_prefix='/autodoor/' and
gated by match_fn (presence of ado.openOptions) rather than the prefix
alone, so it only claims the variant-declaration hrefs and not
/autodoor/timer/vs/0 -- which doesn't matter in practice anyway, since
that href's own exact-href AUTO_DOOR_TIMER cap always wins first.

Registry-scoped (refrigerator.py's own pattern_capabilities list), not
global ignored.py -- the unknown-device-type fallback that motivates
ignored.py's 'exact hrefs only' rule never reaches this registry, so the
same constraint doesn't apply. A fourth fridge sub-type reporting this
feature at a new href now needs no code change to stay covered.
This commit is contained in:
Marc Billow committed 2026-08-09 01:06:37 +00:00
1 parent 5e2c23a62d
commit 95ce358d55
5 files changed
+34 -18

No files matched your search

@@ -74,5 +74,7 @@ def test_winecellar_pantry_zone_mode_options_and_write():
def test_winecellar_variant_and_info_hrefs_bound_with_no_entities():
assert fridge.AUTO_DOOR_WINECELLAR.entities == ()
assert fridge.AUTO_DOOR_VARIANT.entities == ()
assert fridge.WINECELLAR_INFO.entities == ()
_reg, resources = _fridge()
assert fridge.AUTO_DOOR_VARIANT.match_fn(resources["/autodoor/winecellar/vs/0"], resources)