fix(testing): PluginDimmer DON takes an on-level param so it classifies LIGHT#171
Conversation
…es LIGHT `_build_plugin_dimmer_nodedef`'s `DON` was parameterless, which post-#158 correctly classifies as SWITCH (HA can't drive brightness via a bare `DON`). The fixture's name/docstring (`PLUGIN_DIMMER_NODEDEF_ID`, "light controllable") then contradicted its actual classification. Resolution (1) from the issue: give `DON` an `I_OL` on-level param so it genuinely classifies LIGHT, matching the fixture's purpose (the only LIGHT-plugin fixture). Adds a regression assertion on `classify().controllable` so it can't drift again. Closes #159 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Claude finished @shbatm's task in 41s —— View job Code Review — PR #171
Summary: This is a targeted, correct fix with a solid regression guard. The change is minimal and well-reasoned.
|
Closes #159
Problem
pyisyox/testing/__init__.py_build_plugin_dimmer_nodedef()is named/exposed as a dimmer (PLUGIN_DIMMER_NODEDEF_ID = "PluginDimmer", docstring "light controllable") but itsDONwas parameterless:{"id": "DON", "name": "On"},Post-#158, a parameterless
DONcorrectly classifies as SWITCH (HA can't drive brightness via a bareDON). The fixture's name/docstring then contradicted its actual classification. The pyisyox suite never asserted itscontrollable, so it slipped through; it surfaced downstream in hacs-udi-iox's suite.Fix — resolution (1) from the issue (maintainer-preferred)
Give
DONanI_OLon-level param so it genuinely classifies LIGHT (the on-level param is exactly what_detect_controllable'son_takes_levellooks for; combined with the fixture's existingBRT/DIMdimmer hints → LIGHT). The fixture's name/docstring are now accurate. Param style matches the fixture's ownSETMODE/THRESHOLDparams ({"id": "", "editor": "..."}).Docstring updated to state why the param matters (so it can't be "cleaned up" back to parameterless).
Regression guard
New
test_dimmer_plugin_nodedef_classifies_lightassertsclassify(nd).controllable is ControllablePlatform.LIGHT— the assertion the issue explicitly asked for, so the fixture can't silently drift again.Verification
Test-infra only; not user-facing. Pairs with #170 for the upcoming beta bump.
🤖 Generated with Claude Code