mirror of
https://github.com/esphome/esphome.git
synced 2026-06-24 13:27:14 +00:00
Add the C++ `final` specifier to leaf, user-configurable component classes and automation action/trigger/condition primitives so that classes meant to be terminal cannot be subclassed by external components. Only classes never used as a base anywhere in the tree are marked. Part 19 of 21, split alphabetically by component (uart .. wl_134).
29 lines
588 B
C++
29 lines
588 B
C++
#pragma once
|
|
|
|
#include "esphome/core/defines.h"
|
|
|
|
#ifdef USE_TIME
|
|
|
|
#include "esphome/components/sensor/sensor.h"
|
|
#include "esphome/components/time/real_time_clock.h"
|
|
#include "esphome/core/component.h"
|
|
|
|
namespace esphome::uptime {
|
|
|
|
class UptimeTimestampSensor final : public sensor::Sensor, public Component {
|
|
public:
|
|
void setup() override;
|
|
void dump_config() override;
|
|
|
|
float get_setup_priority() const override;
|
|
|
|
void set_time(time::RealTimeClock *time) { this->time_ = time; }
|
|
|
|
protected:
|
|
time::RealTimeClock *time_;
|
|
};
|
|
|
|
} // namespace esphome::uptime
|
|
|
|
#endif // USE_TIME
|