mirror of
https://github.com/esphome/esphome.git
synced 2026-09-21 12:08:38 +00:00
23 lines
688 B
C++
23 lines
688 B
C++
#pragma once
|
|
|
|
#include "esphome/core/component.h"
|
|
#include "esphome/components/text_sensor/text_sensor.h"
|
|
|
|
namespace esphome::version {
|
|
|
|
class VersionTextSensor final : public text_sensor::TextSensor, public Component {
|
|
public:
|
|
// User provided, not "= default": `new(p) VersionTextSensor()` would zero-fill .bss that is already zero.
|
|
VersionTextSensor() {}
|
|
void set_hide_hash(bool hide_hash) { this->hide_hash_ = hide_hash; }
|
|
void set_hide_timestamp(bool hide_timestamp) { this->hide_timestamp_ = hide_timestamp; }
|
|
void setup() override;
|
|
void dump_config() override;
|
|
|
|
protected:
|
|
bool hide_hash_{false};
|
|
bool hide_timestamp_{false};
|
|
};
|
|
|
|
} // namespace esphome::version
|