ESPHome 2025.5.0
Loading...
Searching...
No Matches
micronova_switch.cpp
Go to the documentation of this file.
1#include "micronova_switch.h"
2
3namespace esphome {
4namespace micronova {
5
7 switch (this->get_function()) {
9 if (state) {
10 // Only send power-on when current state is Off
11 if (this->micronova_->get_current_stove_state() == 0) {
13 this->publish_state(true);
14 } else {
15 ESP_LOGW(TAG, "Unable to turn stove on, invalid state: %d", micronova_->get_current_stove_state());
16 }
17 } else {
18 // don't send power-off when status is Off or Final cleaning
21 this->publish_state(false);
22 } else {
23 ESP_LOGW(TAG, "Unable to turn stove off, invalid state: %d", micronova_->get_current_stove_state());
24 }
25 }
26 this->micronova_->update();
27 break;
28
29 default:
30 break;
31 }
32}
33
34} // namespace micronova
35} // namespace esphome
void write_address(uint8_t location, uint8_t address, uint8_t data)
void write_state(bool state) override
void publish_state(bool state)
Publish a state to the front-end from the back-end.
Definition switch.cpp:47
bool state
Definition fan.h:0
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7