5 namespace uponor_smatrix {
7 static const char *
const TAG =
"uponor_smatrix.sensor";
10 ESP_LOGCONFIG(TAG,
"Uponor Smatrix Sensor");
11 ESP_LOGCONFIG(TAG,
" Device address: 0x%04X", this->
address_);
12 LOG_SENSOR(
" ",
"Temperature", this->temperature_sensor_);
13 LOG_SENSOR(
" ",
"External Temperature", this->external_temperature_sensor_);
14 LOG_SENSOR(
" ",
"Humidity", this->humidity_sensor_);
18 for (
int i = 0; i < data_len; i++) {
20 case UPONOR_ID_ROOM_TEMP:
21 if (this->temperature_sensor_ !=
nullptr)
22 this->temperature_sensor_->publish_state(
raw_to_celsius(data[i].value));
24 case UPONOR_ID_EXTERNAL_TEMP:
25 if (this->external_temperature_sensor_ !=
nullptr)
26 this->external_temperature_sensor_->publish_state(
raw_to_celsius(data[i].value));
28 case UPONOR_ID_HUMIDITY:
29 if (this->humidity_sensor_ !=
nullptr)
30 this->humidity_sensor_->publish_state(data[i].value & 0x00FF);
float raw_to_celsius(uint16_t raw)
virtual void dump_config()
void on_device_data(const UponorSmatrixData *data, size_t data_len) override
Implementation of SPI Controller mode.