ESPHome 2026.11.0b6
Loading...
Searching...
No Matches
output_button.cpp
Go to the documentation of this file.
1#include "output_button.h"
3
4namespace esphome::output {
5
7 output->turn_on();
8 // Keyed on the button, so a second press replaces the pending reset instead of stacking another
9 App.scheduler.set_timeout(button, duration, [output]() { output->turn_off(); });
10}
11
12} // namespace esphome::output
Base class for all buttons.
Definition button.h:25
virtual void turn_off()
Disable this binary output.
virtual void turn_on()
Enable this binary output.
uint8_t duration
Definition msa3xx.h:0
void press_output_button(button::Button *button, BinaryOutput *output, uint32_t duration)
Turn the output on and off again after duration ms; a second press restarts the wait.
Application App
Global storage of Application pointer - only one Application can exist.
static void uint32_t