Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement ? Dimmer function #19

Open
IanAdd opened this issue Nov 6, 2023 · 2 comments
Open

Enhancement ? Dimmer function #19

IanAdd opened this issue Nov 6, 2023 · 2 comments

Comments

@IanAdd
Copy link

IanAdd commented Nov 6, 2023

I can't yet work out how to detect the start of a button press, I think I just see the binary sensor you've created toggle on release.

Am I missing some understanding ?

I am hoping that if I can see the start of a button press I can cycle through brightness levels until the button is released.

@brotaxt
Copy link

brotaxt commented Nov 22, 2023

+1 That would be an awesome feature!

@flonou
Copy link

flonou commented May 9, 2024

I think you can do that in two ways:

on_press in

tx_ultimate_touch:
  id: tx_touch
  uart: my_uart

  on_press:
     - logger.log: "press left"

or on_press in the binary sensor. But that required lots of code changes on my part and using multi click. Hopefully this will help going in the right direction:

on_multi_click:
    - timing:
      - ON for at most $long_press_time
      - OFF for at least $double_click_max_interval
      then:
        - logger.log: "press left"
    - timing:
      - ON for at most $long_press_time
      - OFF for at least $double_click_max_interval
      then:
        - logger.log: "Release left"
    - timing:
      - ON for at least $long_press_time
      then:
        - logger.log: "long press left"
    on_click:
      min_length: $long_press_time
      max_length: $long_press_discard_time
      then:
        - logger.log: "long press release left"
    on_double_click:
      then:
        - logger.log: "Double Click left"
    on_press:
      - logger.log: "on press left"

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

No branches or pull requests

3 participants