9 static const char *
const TAG =
"uptime.sensor";
12 const uint32_t ms =
millis();
13 const uint64_t ms_mask = (1ULL << 32) - 1ULL;
14 const uint32_t last_ms = this->
uptime_ & ms_mask;
16 this->
uptime_ += ms_mask + 1ULL;
17 ESP_LOGD(TAG,
"Detected roll-over \xf0\x9f\xa6\x84");
25 const uint64_t seconds_int = this->
uptime_ / 1000ULL;
26 const float seconds = float(seconds_int) + (this->
uptime_ % 1000ULL) / 1000.0f;
std::string unique_id() override
uint32_t IRAM_ATTR HOT millis()
float get_setup_priority() const override
std::string get_mac_address()
Get the device MAC address as a string, in lowercase hex notation.
void publish_state(float state)
Publish a new state to the front-end.
const float HARDWARE
For components that deal with hardware and are very important like GPIO switch.
This is a workaround until we can figure out a way to get the tflite-micro idf component code availab...
void dump_config() override