ESPHome 2026.11.0b6
Loading...
Searching...
No Matches
xiaomi_mue4094rt.cpp
Go to the documentation of this file.
1#include "xiaomi_mue4094rt.h"
2#include "esphome/core/log.h"
3
5
6ESPHOME_LOG_TAG(TAG, "xiaomi_mue4094rt");
7
8static constexpr uint32_t MOTION_TIMEOUT_ID = 0;
9
11 ESP_LOGCONFIG(TAG, "Xiaomi MUE4094RT");
12 LOG_BINARY_SENSOR(" ", "Motion", this);
13}
14
16 if (res.has_motion.has_value()) {
17 this->publish_state(*res.has_motion);
18 this->set_timeout(MOTION_TIMEOUT_ID, timeout_, [this]() { this->publish_state(false); });
19 }
20}
21
22} // namespace esphome::xiaomi_mue4094rt
void set_timeout(const char *name, uint32_t timeout, std::function< void()> &&f)
Set a timeout function with a const char* name.
Definition component.cpp:96
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_mue4094rt")
static void uint32_t