Skip to content

Add light_on_off_toggle option for ON/OFF buttons#8

Open
csmarshall wants to merge 1 commit into
smartqasa:mainfrom
csmarshall:feature/light-toggle-mode
Open

Add light_on_off_toggle option for ON/OFF buttons#8
csmarshall wants to merge 1 commit into
smartqasa:mainfrom
csmarshall:feature/light-toggle-mode

Conversation

@csmarshall
Copy link
Copy Markdown

Summary

Adds a new light_on_off_toggle configuration option that changes ON and OFF button behavior from discrete turn_on/turn_off to toggle.

  • New boolean config option light_on_off_toggle (default: false)
  • When enabled, both ON and OFF buttons check current light state and flip it
  • Works with all Pico types: 3BRL (tap toggles), P2B and 2B (tap toggles, hold still ramps in the original direction)
  • Follows existing config patterns (_normalize_bool, defaults merging, per-device override)

Use case

When a Pico controls a single light or light group, it's convenient to have either button toggle regardless of current state — especially in the dark where you don't want to think about which button you're reaching for. This is a common request in the HA community for Pico remotes.

Changes

  • config.py — new light_on_off_toggle field on PicoConfig, parsed via _normalize_bool
  • actions/light_actions.pypress_on/press_off and release_on/release_off check the flag; new _toggle() method reads entity state
  • README.md — config table, dedicated docs section, behavior table updated, sample config example

Example

pico_link:
  devices:
    - name: Living Room Remote
      type: 3BRL
      lights:
        - light.living_room_lamp
      light_on_off_toggle: true

Backward compatible

Defaults to false — no behavior change for existing configs.

When enabled, both ON and OFF buttons check the current light state
and toggle it rather than using discrete turn_on/turn_off actions.
Works with all Pico types (P2B, 2B, 3BRL). For P2B/2B, tap toggles
while hold still ramps in the original direction.

Useful for single-light setups where either button should work
regardless of current state.
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