22 uint32_t uptime =
static_cast<uint32_t
>(
millis_64() / 1000);
26 unsigned seconds = uptime % 60;
28 unsigned minutes = uptime % 60;
30 unsigned hours = uptime % 24;
32 unsigned days = uptime;
35 bool seconds_enabled = interval < 30;
36 bool minutes_enabled = interval < 1800;
37 bool hours_enabled = interval < 12 * 3600;
40 bool show_days = this->
expand_ || days > 0;
41 bool show_hours = hours_enabled && (show_days || hours > 0);
42 bool show_minutes = minutes_enabled && (show_hours || minutes > 0);
43 bool show_seconds = seconds_enabled && (show_minutes || seconds > 0);
46 if (!show_days && !show_hours && !show_minutes && !show_seconds) {
47 if (seconds_enabled) {
49 }
else if (minutes_enabled) {
51 }
else if (hours_enabled) {
void publish_state(const std::string &state)
float get_setup_priority() const override
const char * seconds_text_
void dump_config() override
const char * minutes_text_