mirror of
https://github.com/esphome/esphome.git
synced 2024-12-02 11:44:13 +01:00
23 lines
443 B
C++
23 lines
443 B
C++
#pragma once
|
|
|
|
#include "esphome/core/component.h"
|
|
#include "esphome/components/sensor/sensor.h"
|
|
|
|
namespace esphome {
|
|
namespace uptime {
|
|
|
|
class UptimeSensor : public sensor::Sensor, public PollingComponent {
|
|
public:
|
|
void update() override;
|
|
void dump_config() override;
|
|
|
|
float get_setup_priority() const override;
|
|
|
|
std::string unique_id() override;
|
|
|
|
protected:
|
|
uint64_t uptime_{0};
|
|
};
|
|
|
|
} // namespace uptime
|
|
} // namespace esphome
|