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

Help with 2 Channels switch #1

Open
Morcegolas opened this issue Dec 7, 2024 · 1 comment
Open

Help with 2 Channels switch #1

Morcegolas opened this issue Dec 7, 2024 · 1 comment

Comments

@Morcegolas
Copy link

I have a 2 Channel switch, and I'm trying to get it to work with your configuration, already changed the binary_sensor code but its like my switch has 3 buttons, I have to press it in the middle so I can use the button of the right. Can you help me please?
I already tried these two configs, changing from middle to right button but the result is the same, I have to press in the middle for it to work.

`binary_sensor:

  • platform: custom
    lambda: |-
    auto touch_panel = new touch_panel::TouchPanel(id(uart_bus));
    App.register_component(touch_panel);
    return {
    touch_panel->left,
    touch_panel->middle,
    touch_panel->right,
    touch_panel->two_finger,
    touch_panel->dragged_ltr,
    touch_panel->dragged_rtl,
    };
    binary_sensors:
    • id: button_left
      name: "Left Button"
      on_press:
      • switch.toggle: relay1
      • switch.turn_on: haptics
      • button.press: light_relays
    • id: button_middle
      name: "Middle Button"
      on_press:
      • switch.toggle: relay2
      • switch.turn_on: haptics
      • button.press: light_relays
    • id: button_two_finger
      name: "Two Fingers"
    • id: button_dragged_ltr
      name: "Dragged Left to Right"
    • id: button_dragged_rtl
      name: "Dragged Right to Left"`

`binary_sensor:

  • platform: custom
    lambda: |-
    auto touch_panel = new touch_panel::TouchPanel(id(uart_bus));
    App.register_component(touch_panel);
    return {
    touch_panel->left,
    touch_panel->middle,
    touch_panel->right,
    touch_panel->two_finger,
    touch_panel->dragged_ltr,
    touch_panel->dragged_rtl,
    };
    binary_sensors:
    • id: button_left
      name: "Left Button"
      on_press:
      • switch.toggle: relay1
      • switch.turn_on: haptics
      • button.press: light_relays
    • id: button_right
      name: "Right Button"
      on_press:
      • switch.toggle: relay2
      • switch.turn_on: haptics
      • button.press: light_relays
    • id: button_two_finger
      name: "Two Fingers"
    • id: button_dragged_ltr
      name: "Dragged Left to Right"
    • id: button_dragged_rtl
      name: "Dragged Right to Left"`
@Morcegolas
Copy link
Author

What I did was changing this part of the code to this, it seams to be working, if its not the right way tell me please.

`binary_sensor:

  • platform: custom
    lambda: |-
    auto touch_panel = new touch_panel::TouchPanel(id(uart_bus));
    App.register_component(touch_panel);
    return {
    touch_panel->left,
    touch_panel->right,
    };
    binary_sensors:
    • id: button_left
      name: "Left Button"
      on_press:
      • switch.toggle: relay1
      • switch.turn_on: haptics
      • button.press: light_relays
    • id: button_right
      name: "Right Button"
      on_press:
      • switch.toggle: relay2
      • switch.turn_on: haptics
      • button.press: light_relays`

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

1 participant