ESPHome 2026.11.0b6
Loading...
Searching...
No Matches
uptime_text_sensor.h
Go to the documentation of this file.
1#pragma once
2
4
7
8namespace esphome::uptime {
9
13 const char *days;
14 const char *hours;
15 const char *minutes;
16 const char *seconds;
17 const char *separator;
18 uint8_t expand;
19};
20
22 public:
24 void update() override;
27 void publish_uptime(uint32_t uptime);
28 void dump_config() override;
29 void setup() override;
30
31 float get_setup_priority() const override;
32
33 protected:
34 void publish_uptime_(uint32_t uptime);
35
37};
38
39} // namespace esphome::uptime
This class simplifies creating components that periodically check a state.
Definition component.h:532
float get_setup_priority() const override
void publish_uptime(uint32_t uptime)
Publish uptime (in seconds) as text, keeping only the units the update interval can resolve.
UptimeTextSensor(const UptimeFormat *format)
const char * format
static void uint32_t
Emitted by codegen in PROGMEM once per distinct format.