ESPHome  2025.2.0
uptime_text_sensor.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "esphome/core/defines.h"
4 
7 
8 namespace esphome {
9 namespace uptime {
10 
12  public:
13  void update() override;
14  void dump_config() override;
15  void setup() override;
16 
17  float get_setup_priority() const override;
18 
19  protected:
20  uint32_t uptime_{0}; // uptime in seconds, will overflow after 136 years
21  uint32_t last_ms_{0};
22 };
23 
24 } // namespace uptime
25 } // namespace esphome
This class simplifies creating components that periodically check a state.
Definition: component.h:283
float get_setup_priority() const override
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7