ESPHome 2025.5.0
Loading...
Searching...
No Matches
micronova_sensor.cpp
Go to the documentation of this file.
1#include "micronova_sensor.h"
2
3namespace esphome {
4namespace micronova {
5
6void MicroNovaSensor::process_value_from_stove(int value_from_stove) {
7 if (value_from_stove == -1) {
8 this->publish_state(NAN);
9 return;
10 }
11
12 float new_sensor_value = (float) value_from_stove;
13 switch (this->get_function()) {
15 new_sensor_value = new_sensor_value / 2;
16 break;
18 break;
20 new_sensor_value = new_sensor_value == 0 ? 0 : (new_sensor_value * 10) + this->fan_speed_offset_;
21 break;
23 new_sensor_value = new_sensor_value / 2;
24 break;
26 new_sensor_value = new_sensor_value / 10;
27 break;
28 default:
29 break;
30 }
31 this->publish_state(new_sensor_value);
32}
33
34} // namespace micronova
35} // namespace esphome
void process_value_from_stove(int value_from_stove) override
void publish_state(float state)
Publish a new state to the front-end.
Definition sensor.cpp:39
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7