14 static const char *
const TAG =
"micronova";
15 static const int STOVE_REPLY_DELAY = 60;
17 static const std::string STOVE_STATES[11] = {
"Off",
53 virtual void dump_config();
69 uint8_t memory_location_ = 0;
70 uint8_t memory_address_ = 0;
77 virtual void request_value_from_stove() = 0;
78 virtual void process_value_from_stove(
int value_from_stove) = 0;
84 bool needs_update_ =
false;
90 virtual void request_value_from_stove() = 0;
91 virtual void process_value_from_stove(
int value_from_stove) = 0;
97 bool needs_update_ =
false;
103 virtual void set_stove_state(
bool v) = 0;
104 virtual bool get_stove_state() = 0;
107 uint8_t memory_data_on_ = 0;
108 uint8_t memory_data_off_ = 0;
116 uint8_t memory_data_ = 0;
125 void setup()
override;
126 void loop()
override;
127 void update()
override;
128 void dump_config()
override;
132 void write_address(uint8_t location, uint8_t address, uint8_t data);
133 int read_stove_reply();
144 uint8_t current_stove_state_ = 0;
159 std::vector<MicroNovaSensorListener *> micronova_listeners_{};
void set_enable_rx_pin(GPIOPin *enable_rx_pin)
MicroNovaFunctions get_function()
void set_needs_update(bool u)
MicroNovaSwitchListener * get_stove_switch()
This class simplifies creating components that periodically check a state.
MicroNovaSerialTransmission current_transmission_
uint8_t get_memory_address()
uint32_t request_transmission_time
Mutex reply_pending_mutex_
MicroNovaSensorListener()
void set_needs_update(bool u)
MicroNovaBaseListener(MicroNova *m)
uint8_t get_current_stove_state()
MicroNovaSensorListener * initiating_listener
void set_current_stove_state(uint8_t s)
void set_stove(MicroNovaSwitchListener *s)
MicroNovaSwitchListener(MicroNova *m)
void set_memory_location(uint8_t l)
void set_function(MicroNovaFunctions f)
uint8_t get_memory_location()
MicroNovaNumberListener(MicroNova *m)
void set_memory_address(uint8_t a)
void set_micronova_object(MicroNova *m)
Implementation of SPI Controller mode.
MicroNovaSensorListener(MicroNova *m)
void register_micronova_listener(MicroNovaSensorListener *l)
Mutex implementation, with API based on the unavailable std::mutex.