fix: address final review findings

- for_device(): suffix fallback for descriptive names
  ("french_door_refrigerator" → refrigerator registry)
- Capability.href_prefix: replaces rt_filter for pattern caps;
  DOOR_GENERIC now uses href_prefix='/door/' (batch reps have no rt)
- discover(): apply href_prefix gate before rt_filter in pattern loop
- Remove dead bound_hrefs variable from discover()
- Remove vestigial default_observe_port from RuntimeDescriptor
This commit is contained in:
Marc Billow committed 2026-06-30 16:33:36 -05:00
1 parent 6f681622c2
commit 1c4cb2e272
8 files changed
+26 -11

No files matched your search

+1
View File
@@ -13,6 +13,7 @@ class Capability:
entities: tuple[SamsungEntityDescription, ...] = ()
poll_tier: str = 'warm' # 'hot' | 'warm' | 'cold'
rt_filter: Optional[str] = None # bind only if rt_filter in rep.get('rt', ())
href_prefix: Optional[str] = None # pattern caps only: bind only if href starts with this
match_fn: Optional[Callable[[dict, dict], bool]] = None # match_fn(rep, resources) -> bool
key_fn: Optional[Callable[[str], str]] = None # href -> entity key (pattern caps)
# Rare optional hooks — only operational-state-style resources use these.