7 namespace xiaomi_wx08zm {
9 static const char *
const TAG =
"xiaomi_wx08zm";
12 ESP_LOGCONFIG(TAG,
"Xiaomi WX08ZM");
13 LOG_BINARY_SENSOR(
" ",
"Mosquito Repellent",
this);
14 LOG_SENSOR(
" ",
"Tablet Resource", this->
tablet_);
20 ESP_LOGVV(TAG,
"parse_device(): unknown MAC address.");
23 ESP_LOGVV(TAG,
"parse_device(): MAC address %s found.", device.
address_str().c_str());
28 if (!res.has_value()) {
31 if (res->is_duplicate) {
34 if (res->has_encryption) {
35 ESP_LOGVV(TAG,
"parse_device(): payload decryption is currently not supported on this device.");
44 if (res->is_active.has_value()) {
47 if (res->tablet.has_value() && this->
tablet_ !=
nullptr)
49 if (res->battery_level.has_value() && this->
battery_level_ !=
nullptr)
sensor::Sensor * battery_level_
std::string address_str() const
void publish_state(float state)
Publish a new state to the front-end.
bool parse_device(const esp32_ble_tracker::ESPBTDevice &device) override
void publish_state(bool state)
Publish a new state to the front-end.
const std::vector< ServiceData > & get_service_datas() const
void dump_config() override
uint64_t address_uint64() const
bool parse_xiaomi_message(const std::vector< uint8_t > &message, XiaomiParseResult &result)
optional< XiaomiParseResult > parse_xiaomi_header(const esp32_ble_tracker::ServiceData &service_data)
bool report_xiaomi_results(const optional< XiaomiParseResult > &result, const std::string &address)
Implementation of SPI Controller mode.