Split microwaves into their own device type instead of the oven registry

Microwaves (combi and plain) were routed onto the oven registry (issue
#121), which meant entities carried oven-flavored keys (oven_state,
oven_mode, oven_setpoint) and inherited oven-specific behavior that's
wrong for this family: a 30-270C setpoint range instead of this family's
actual 40-200C, a cooking-mode list missing MicroWave/MicroWaveGrill/
MicroWaveConvection/KeepWarm entirely, and a lamp switch that read/wrote
the oven's 'UpperLamp' option token instead of this family's 'Lamp' token.

Adds a microwave device type (by_type/microwave.py,
capabilities/microwave.py) that reuses the oven board family's shared
operational-state/door/connected/recipe-cook capabilities but defines its
own cooking-mode, setpoint, and cavity capabilities with the corrected
bounds/vocabulary, plus a new power_level sensor for the cavity's Watt
setting that was previously unexposed.
This commit is contained in:
Marc Billow committed 2026-07-27 22:05:54 +00:00
1 parent 7c68d478af
commit a1f14cd633
11 files changed
+472 -34

No files matched your search

+11 -10
View File
@@ -568,19 +568,20 @@ def test_registry_reproduces_golden_state_keys_for_airconditioner_windfree_oscil
)
def test_registry_reproduces_golden_state_keys_for_oven_mw7300b():
def test_registry_reproduces_golden_state_keys_for_microwave_mw7300b():
"""TP1X_DA-KS-MICROWAVE-01041 combi microwave (model MW7300B, issue
#121) -- reports no oneUiVersion; resolved via the '-MICROWAVE-'
modelNum token fallback onto the *existing* oven registry rather than
a new device type, since it shares the same '/oven/vs/0' cavity and
'/mode/vs/0' cook-mode shape (Convection/AirFryer/Grill/MicroWave*).
The only href the oven registry didn't already cover was
/recipe/cook/vs/0 (oven.OVEN_RECIPE_COOK, an empty quick-recipe-display
blob with no entity)."""
modelNum token fallback onto its own microwave registry. Shares the
oven board family's operational-state/door/connected/recipe-cook
Capability objects (reused directly from oven.py), but has its own
cooking-mode vocabulary, setpoint bounds, and cavity power-level sensor
(capabilities/microwave.py) -- this device's initial routing folded it
into the oven registry (issue #121); split into its own device type per
user feedback that microwaves shouldn't show up as ovens."""
from tests.conftest import _load_device
resources = _load_device('oven_mw7300b')
golden = json.loads((GOLDEN / 'oven_mw7300b.json').read_text())
state_keys = _new_state_keys('oven_mw7300b', resources)
resources = _load_device('microwave_mw7300b')
golden = json.loads((GOLDEN / 'microwave_mw7300b.json').read_text())
state_keys = _new_state_keys('microwave_mw7300b', resources)
assert set(state_keys) == set(golden['state_keys']), (
f"state_keys mismatch:\n"
f" extra: {sorted(set(state_keys) - set(golden['state_keys']))}\n"