I’m running esphome on a Sonoff TX Ultimate that requires a custom lambda function to map the touchpad to two buttons.
Since custom components were removed from esphome at the end of 2024, I need to move the following custom component into an external component but I have no clue how to do this.
Any help would be appreciated. Here is the function in question.
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,
touch_panel->middle,
touch_panel->two_finger,
touch_panel->dragged_ltr,
touch_panel->dragged_rtl,
};
The full code is available in this github repo.