7 static 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());
virtual void digital_write(bool value)=0
bool cancel_timeout(const std::string &name)
Cancel a timeout function.
void dump_config() override
void set_timeout(const std::string &name, uint32_t timeout, std::function< void()> &&f)
Set a timeout function with a unique name.
uint32_t interlock_wait_time_
float get_setup_priority() const override
optional< bool > get_initial_state_with_restore_mode()
Returns the initial state of the switch, after applying restore mode rules.
void turn_on()
Turn this switch on.
void set_interlock(const std::vector< Switch *> &interlock)
constexpr const char * c_str() const
const float HARDWARE
For components that deal with hardware and are very important like GPIO switch.
Implementation of SPI Controller mode.
void write_state(bool state) override
std::vector< Switch * > interlock_
void publish_state(bool state)
Publish a state to the front-end from the back-end.
bool state
The current reported state of the binary sensor.
value_type value_or(U const &v) const
void turn_off()
Turn this switch off.