7static const char *
const TAG =
"switch.gpio";
11 ESP_LOGCONFIG(TAG,
"Setting up GPIO Switch '%s'...", this->
name_.
c_str());
30 LOG_SWITCH(
"",
"GPIO Switch",
this);
31 LOG_PIN(
" Pin: ", this->
pin_);
33 ESP_LOGCONFIG(TAG,
" Interlocks:");
37 ESP_LOGCONFIG(TAG,
" %s", lock->get_name().c_str());
bool cancel_timeout(const std::string &name)
Cancel a timeout function.
void set_timeout(const std::string &name, uint32_t timeout, std::function< void()> &&f)
Set a timeout function with a unique name.
virtual void digital_write(bool value)=0
constexpr const char * c_str() const
void dump_config() override
uint32_t interlock_wait_time_
float get_setup_priority() const override
void set_interlock(const std::vector< Switch * > &interlock)
void write_state(bool state) override
std::vector< Switch * > interlock_
value_type value_or(U const &v) const
void turn_on()
Turn this switch on.
void turn_off()
Turn this switch off.
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.
const float HARDWARE
For components that deal with hardware and are very important like GPIO switch.
Providing packet encoding functions for exchanging data with a remote host.