Skip to content

Toggle main parameters through state attributes - #9

Merged
MarkParker5 merged 3 commits into
developfrom
feature/state-toggles
Oct 14, 2026
Merged

MarkParker5 merged 3 commits into
developfrom
feature/state-toggles

Conversation

@MarkParker5

Copy link
Copy Markdown
Member

One-way main parameters become toggles. The state attribute is the main parameter, with a two-value default_value cycle. The Hub sends the next value, and the controller sends the matching command:

Cluster Main parameter Tap sends
DoorLock LockState {Locked, Unlocked} LockDoor / UnlockDoor; NotFullyLocked or Unlatched → Lock
Valve CurrentState {Closed, Open} Close / Open; Transitioning → Close
WindowCovering CurrentPositionLiftPercentage {0, 100} UpOrOpen / DownOrClose; mid → open
MediaPlayback CurrentState {Playing, Paused} Play / Pause; NotPlaying → Play
RvcOperationalState OperationalState {Running, Paused} Resume / Pause; docked → Resume
OperationalState OperationalState {Running, Paused} Resume / Pause; idle → error, never Start
FanControl FanMode {Off, On} (written) Off / On; Low/Medium/High → Off
ClosureControl MainState, a one-value button Stop while moving; else MoveTo FullyOpen if fully closed, FullyClosed otherwise
  • The state attributes are control: the Hub forwards commands for control parameters only (relay_controller.send_command), so no Hub change is needed
  • Fallbacks when a device lacks the attribute or a command: a cover without position keeps UpOrOpen, a player without Pause keeps Play, a vacuum without Pause keeps Resume, and an OperationalState device without Pause/Resume gets no main parameter
  • DefaultParams allows a set; requires SDK 0.1.7, which keeps a set default_value through JSON (pulls pydantic 2.14 and zeroconf 0.151.5 into the lock)

Tests first. Local: poe check --ci green, 87 passed, 6 skipped (MVD, macOS).

@MarkParker5
MarkParker5 merged commit 23d020a into develop Oct 14, 2026
7 checks passed
@MarkParker5
MarkParker5 deleted the feature/state-toggles branch October 14, 2026 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant