ESPHome 2026.11.0b6
Loading...
Searching...
No Matches
xiaomi_wx08zm.cpp
Go to the documentation of this file.
1#include "xiaomi_wx08zm.h"
2#include "esphome/core/log.h"
3
5
6ESPHOME_LOG_TAG(TAG, "xiaomi_wx08zm");
7
9 ESP_LOGCONFIG(TAG, "Xiaomi WX08ZM");
10 LOG_BINARY_SENSOR(" ", "Mosquito Repellent", this);
11 LOG_SENSOR(" ", "Tablet Resource", this->tablet_sensor_);
12 LOG_SENSOR(" ", "Battery Level", this->battery_level_sensor_);
13}
14
16 if (res.is_active.has_value()) {
17 this->publish_state(*res.is_active);
18 }
19 publish_optional(this->tablet_sensor_, res.tablet);
20 publish_optional(this->battery_level_sensor_, res.battery_level);
21}
22
23} // namespace esphome::xiaomi_wx08zm
virtual void dump_config()
void publish_state(bool new_state)
Publish a new state to the front-end.
void publish_result(const xiaomi_ble::XiaomiParseResult &res) override
ESPHOME_LOG_TAG(TAG, "xiaomi_wx08zm")
void publish_optional(E *entity, const optional< V > &value)
Publish value to entity when the entity is configured and the value is set.