ESPHome  2024.11.0
micronova_switch.h
Go to the documentation of this file.
1 #pragma once
2 
6 
7 namespace esphome {
8 namespace micronova {
9 
11  public:
13  void dump_config() override { LOG_SWITCH("", "Micronova switch", this); }
14 
15  void set_stove_state(bool v) override { this->publish_state(v); }
16  bool get_stove_state() override { return this->state; }
17 
18  void set_memory_data_on(uint8_t f) { this->memory_data_on_ = f; }
19  uint8_t get_memory_data_on() { return this->memory_data_on_; }
20 
21  void set_memory_data_off(uint8_t f) { this->memory_data_off_ = f; }
22  uint8_t get_memory_data_off() { return this->memory_data_off_; }
23 
24  protected:
25  void write_state(bool state) override;
26 };
27 
28 } // namespace micronova
29 } // namespace esphome
Base class for all switches.
Definition: switch.h:39
void write_state(bool state) override
void set_stove_state(bool v) override
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
uint8_t m
Definition: bl0906.h:208
void publish_state(bool state)
Publish a state to the front-end from the back-end.
Definition: switch.cpp:47
bool state
The current reported state of the binary sensor.
Definition: switch.h:53