8static const char *
const TAG =
"xiaomi_mue4094rt";
11 ESP_LOGCONFIG(TAG,
"Xiaomi MUE4094RT");
12 LOG_BINARY_SENSOR(
" ",
"Motion",
this);
17 ESP_LOGVV(TAG,
"parse_device(): unknown MAC address.");
20 char addr_buf[MAC_ADDRESS_PRETTY_BUFFER_SIZE];
22 ESP_LOGVV(TAG,
"parse_device(): MAC address %s found.", addr_str);
27 if (!res.has_value()) {
30 if (res->is_duplicate) {
33 if (res->has_encryption) {
34 ESP_LOGVV(TAG,
"parse_device(): payload decryption is currently not supported on this device.");
43 if (res->has_motion.has_value()) {
void set_timeout(const char *name, uint32_t timeout, std::function< void()> &&f)
Set a timeout function with a const char* name.
void publish_state(bool new_state)
Publish a new state to the front-end.
const char * address_str_to(char *buf) const
Buffer overload: writes "XX:XX:XX:XX:XX:XX\0" into buf (>= 18 bytes), returns buf.
uint64_t address_uint64() const
Return MAC as packed uint64 (byte 0 in LSB — matches esp32's address_uint64).
const std::vector< ServiceData > & get_service_datas() const
void dump_config() override
bool parse_device(const esp32_ble_tracker::ESPBTDevice &device) override
optional< XiaomiParseResult > parse_xiaomi_header(const esp32_ble_tracker::ServiceData &service_data)
bool parse_xiaomi_message(const std::vector< uint8_t > &message, XiaomiParseResult &result)
bool report_xiaomi_results(const optional< XiaomiParseResult > &result, const char *address)