Commit Graph
20 Commits
Author SHA1 Message Date
Marc Billow 211fcd1324 fix: remove colliding oven caps from global ALL; update golden baselines
OVEN_SETPOINT (/temperatures/vs/0) and OVEN_MODE (/mode/vs/0) collide
with fridge hrefs. Remove from ALL; only OVEN_CAVITY (/oven/vs/0) is
oven-unique. Per-device-type registries (v2 plan) will restore them in
the oven-only registry.

Also updates golden baselines to include legitimate new entities added
since original capture (cycle_active, firmware_update, power_switch for
dishwasher; cabinet_light_switch, ice1 for refrigerator).
2026-06-30 16:32:42 -05:00
Marc Billow 81d97e2fb5 Task 1: Simplify Capability; extend BoundEntity
- Make href Optional[str] = None for pattern capabilities
- Remove observe field (v2 architecture observes all hrefs)
- Add rt_filter, match_fn, key_fn fields to Capability
- Add entities default value tuple[()] to Capability
- Add key_override field to BoundEntity
- Update _key() to use key_override when present
- Update _make_observe_paths() to observe all unique hrefs (OBSERVE as accelerator)
- Guard _build() to skip pattern capabilities (href is None)
- Add test_bound_entity_key_override_takes_precedence test
- Update test_capability_defaults to remove observe assertion

All 61 tests passing (60 existing + 1 new).
2026-06-30 16:32:42 -05:00
Marc Billow 1a76bf6d47 Fix C1 (switch discovery), C2 (power write_fn), I2 (golden oracle)
C1: SwitchDesc MQTT discovery now emits payload_on/off='On'/'Off',
state_on/off='On'/'Off', and a Jinja2 boolean-to-string value_template
so HA can correctly interpret and command switch entities.

C2: POWER write_fn corrected — path is ['power','vs','0'] segment list
(not a single slash-prefixed string), and payload comparison is
p == 'On' (not truthiness) so 'Off' can actually be sent.

I2: Golden regression oracle strengthened to exact equality for both
state_keys and discovery_unique_ids; prior subset-only check allowed
over-production to go undetected. Two golden tests now fail revealing
stale fixtures (dishwasher: +3 keys; refrigerator: +9 keys) — fixtures
intentionally NOT updated, human review required.
2026-06-30 16:32:42 -05:00
Marc Billow 5906aabd7c test: end-to-end discovery pipeline over real dumps 2026-06-30 16:32:42 -05:00
Marc Billow 35222e6be5 refactor: make StateCache descriptor-free 2026-06-30 16:32:37 -05:00
Marc Billow f2c1d8391e feat: read device identity from OCF /oic/p and /oic/d 2026-06-30 16:32:37 -05:00
Marc Billow 246379acbc feat: assemble CAPABILITIES registry with duplicate-href guard 2026-06-30 16:32:37 -05:00
Marc Billow 23d5090faa feat: add oven capabilities and cycle-active gating 2026-06-30 16:32:37 -05:00
Marc Billow 9cbeb6a2b2 feat: add refrigerator capabilities with multi-instance support 2026-06-30 16:32:37 -05:00
Marc Billow 23b4cdc315 feat: add laundry-family capabilities; dishwasher golden green 2026-06-30 16:32:37 -05:00
Marc Billow d720b29a67 test: capture golden baselines from existing descriptors
Generates regression oracle from DISHWASHER and REFRIGERATOR descriptors:
- tests/fixtures/golden/dishwasher.json: 21 state keys, 23 discovery entities
- tests/fixtures/golden/refrigerator.json: 26 state keys, 24 discovery entities
- tests/test_golden_regression.py: parametrized test that will turn green as
  Tasks 9-12 port capabilities into the new registry
2026-06-30 16:32:37 -05:00
Marc Billow 299719f727 feat: add adapter building RuntimeDescriptor from bound entities 2026-06-30 16:32:37 -05:00
Marc Billow 6778c60a09 feat: add operational-state capability with extrapolation hooks 2026-06-30 16:32:37 -05:00
Marc Billow 0499c702d7 refactor: key capabilities on href instead of rt
OCF rt is a schema category shared by many unrelated resources.
The stable unique resource address is the href. Update Capability,
discovery, common capabilities, tests, and plan accordingly.
2026-06-30 16:32:37 -05:00
Marc Billow bdae3cc82d feat: add shared common capabilities 2026-06-30 16:32:37 -05:00
Marc Billow 73fff9c2cf fix: log each unknown rt individually in discover() 2026-06-30 16:32:37 -05:00
Marc Billow 8d63610f82 feat: add runtime capability discovery
Implement discovery module for converting OCF resource metadata into bound
entities, with support for multi-instance device resources and logging of
unknown capabilities.
2026-06-30 16:32:37 -05:00
Marc Billow 9b2eef26f7 feat: add Capability dataclass 2026-06-30 16:32:37 -05:00
Marc Billow 9acc6bc8ce feat: add HA-shaped entity description dataclasses 2026-06-30 16:32:37 -05:00
Marc Billow c6f08ea340 test: add pytest infra and device-dump fixtures 2026-06-30 16:32:37 -05:00