feat(light): add dimmer brightness support for circuits with type 'dimmer'#67
Open
rversaw wants to merge 1 commit into
Open
feat(light): add dimmer brightness support for circuits with type 'dimmer'#67rversaw wants to merge 1 commit into
rversaw wants to merge 1 commit into
Conversation
Circuits reported as type 'dimmer' (circuit type 8 in nodejs-poolController) now expose ColorMode.BRIGHTNESS in Home Assistant instead of ONOFF. Turning on sends a setDimmerLevel command (30-100 in steps of 10); turning off sends level 0. Brightness state is tracked from the 'level' field in circuit events. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
type.name == "dimmer"(circuit type 8 in nodejs-poolController) now useColorMode.BRIGHTNESSinstead ofColorMode.ONOFF.setDimmerLevel: turning on sends asetDimmerLevelcommand with the last-known level (or 100% if no prior level), and turning off sends level 0. This matches the RS-485 behavior of the controller, where brightness and power state are controlled together via the dimmer level command.levelfield from njsPC circuit state events is tracked and converted to the 0–255 scale HA expects. This means physical panel changes to dimmer level (broadcast by IntelliTouch via RS-485 action 171) are reflected in HA in real time.Dependency
This PR depends on tagyoureit/nodejs-poolController#1203, which adds circuit type 8 (Dimmer) and the RS-485 action 171 inbound/outbound handling to njsPC. Without that change, dimmer circuits are not recognized by njsPC and the
setDimmerLevelendpoint is a no-op.Changes
const.py: addsAPI_CIRCUIT_SETDIMMERLEVEL = "state/circuit/setDimmerLevel"constantlight.py:circuit.get("type", {}).get("name") == "dimmer"levelfrom coordinator data updatesasync_turn_on: routes dimmer circuits tosetDimmerLevelwith HA brightness converted to nearest 10% step in 30–100% rangeasync_turn_off: routes dimmer circuits tosetDimmerLevelwith level 0brightnessproperty: returnslevel / 100 * 255for dimmer circuitscolor_mode/supported_color_modes: returnsColorMode.BRIGHTNESSfor dimmer circuitsTest plan
🤖 Generated with Claude Code