5static const char *
const TAG =
"opentherm.switch";
12 if (!restored.has_value()) {
13 ESP_LOGD(TAG,
"Couldn't restore state for OpenTherm switch '%s'", this->
get_name().c_str());
15 ESP_LOGD(TAG,
"Restored state for OpenTherm switch '%s': %d", this->
get_name().c_str(), restored.value());
16 state = restored.value();
22 LOG_SWITCH(
"",
"OpenTherm Switch",
this);
23 ESP_LOGCONFIG(TAG,
" Current state: %d", this->
state);
const StringRef & get_name() const
void dump_config() override
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.