7#ifdef USE_GPIO_SWITCH_INTERLOCK
8static constexpr uint32_t INTERLOCK_TIMEOUT_ID = 0;
23 LOG_SWITCH(
"",
"GPIO Switch",
this);
24 LOG_PIN(
" Pin: ", this->
pin_);
25#ifdef USE_GPIO_SWITCH_INTERLOCK
27 ESP_LOGCONFIG(TAG,
" Interlocks:");
31 ESP_LOGCONFIG(TAG,
" %s", LOG_STR_ARG(
lock->get_log_name()));
37#ifdef USE_GPIO_SWITCH_INTERLOCK
bool cancel_timeout(const char *name)
Cancel a timeout function.
void set_timeout(const char *name, uint32_t timeout, std::function< void()> &&f)
Set a timeout function with a const char* name.
constexpr bool empty() const
virtual void digital_write(bool value)=0
virtual bool is_held() const
void dump_config() override
uint32_t interlock_wait_time_
float get_setup_priority() const override
ConstVector< Switch * > interlock_
void write_state(bool state) override
bool state
The current reported state of the binary sensor.
void publish_state(bool state)
Publish a state to the front-end from the back-end.
optional< bool > get_initial_state_with_restore_mode()
Returns the initial state of the switch, after applying restore mode rules.
void control(bool target_state)
Control this switch using a boolean state value.
ESPHOME_LOG_TAG(TAG, "gpio.binary_sensor")
constexpr float HARDWARE
For components that deal with hardware and are very important like GPIO switch.