ESPHome 2026.11.0b6
Loading...
Searching...
No Matches
airthings_wave_mini.cpp
Go to the documentation of this file.
2
3#ifdef USE_ESP32
4
6
7ESPHOME_LOG_TAG(TAG, "airthings_wave_mini");
8
9void AirthingsWaveMini::read_sensors(uint8_t *raw_value, uint16_t value_len) {
10 auto *value = (WaveMiniReadings *) raw_value;
11
12 if (sizeof(WaveMiniReadings) <= value_len) {
13 PUBLISH_STATE(this->humidity_sensor_, value->humidity / 100.0f);
14
15 PUBLISH_STATE(this->pressure_sensor_, value->pressure / 50.0f);
16
17 PUBLISH_STATE(this->temperature_sensor_, value->temperature / 100.0f - 273.15f);
18
19 if ((this->tvoc_sensor_ != nullptr) && this->is_valid_voc_value_(value->voc)) {
20 this->tvoc_sensor_->publish_state(value->voc);
21 }
22 }
23
24 this->response_received_();
25}
26
28 // these really don't belong here, but there doesn't seem to be a
29 // practical way to have the base class use LOG_SENSOR and include
30 // the TAG from this component
31 LOG_SENSOR(" ", "Humidity", this->humidity_sensor_);
32 LOG_SENSOR(" ", "Temperature", this->temperature_sensor_);
33 LOG_SENSOR(" ", "Pressure", this->pressure_sensor_);
34 LOG_SENSOR(" ", "TVOC", this->tvoc_sensor_);
35 LOG_SENSOR(" ", "Battery Voltage", this->battery_voltage_);
36}
37
39 this->service_uuid_ = espbt::ESPBTUUID::from_raw(SERVICE_UUID);
40 this->sensors_data_characteristic_uuid_ = espbt::ESPBTUUID::from_raw(CHARACTERISTIC_UUID);
42 espbt::ESPBTUUID::from_raw(ACCESS_CONTROL_POINT_CHARACTERISTIC_UUID);
43}
44
45} // namespace esphome::airthings_wave_mini
46
47#endif // USE_ESP32
void read_sensors(uint8_t *raw_value, uint16_t value_len) override
ESPHOME_LOG_TAG(TAG, "airthings_wave_mini")
uint32_t value
Definition hal.cpp:41