9static const char *
const TAG =
"switch.hbridge";
13 ESP_LOGCONFIG(TAG,
"Setting up H-Bridge Switch '%s'...", this->
name_.
c_str());
31 LOG_SWITCH(
"",
"H-Bridge Switch",
this);
32 LOG_PIN(
" On Pin: ", this->
on_pin_);
33 LOG_PIN(
" Off Pin: ", this->
off_pin_);
34 ESP_LOGCONFIG(TAG,
" Pulse length: %" PRId32
" ms", this->
pulse_length_);
36 ESP_LOGCONFIG(TAG,
" Wait time %" PRId32
" ms", this->
wait_time_);
46 uint32_t next_timeout = 0;
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 write_state(bool state) override
void dump_config() override
float get_setup_priority() const override
value_type const & value() const
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.
@ RELAY_STATE_SWITCHING_ON
@ RELAY_STATE_SWITCHING_OFF
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.