6 static const char *
const TAG =
"opentherm.switch";
13 if (!restored.has_value()) {
14 ESP_LOGD(TAG,
"Couldn't restore state for OpenTherm switch '%s'", this->
get_name().c_str());
16 ESP_LOGD(TAG,
"Restored state for OpenTherm switch '%s': %d", this->
get_name().c_str(), restored.value());
17 state = restored.value();
23 LOG_SWITCH(
"",
"OpenTherm Switch",
this);
24 ESP_LOGCONFIG(TAG,
" Current state: %d", this->
state);
void dump_config() override
void write_state(bool state) override
optional< bool > get_initial_state_with_restore_mode()
Returns the initial state of the switch, after applying restore mode rules.
Implementation of SPI Controller mode.
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.
const StringRef & get_name() const