mirror of
https://github.com/esphome/esphome.git
synced 2024-11-10 01:07:45 +01:00
add SUB_TEXT_SENSOR macro (#4448)
This commit is contained in:
parent
77db8c8401
commit
12bef16d54
1 changed files with 7 additions and 0 deletions
|
@ -21,6 +21,13 @@ namespace text_sensor {
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define SUB_TEXT_SENSOR(name) \
|
||||||
|
protected: \
|
||||||
|
text_sensor::TextSensor *name##_text_sensor_{nullptr}; \
|
||||||
|
\
|
||||||
|
public: \
|
||||||
|
void set_##name##_text_sensor(text_sensor::TextSensor *text_sensor) { this->name##_text_sensor_ = text_sensor; }
|
||||||
|
|
||||||
class TextSensor : public EntityBase {
|
class TextSensor : public EntityBase {
|
||||||
public:
|
public:
|
||||||
explicit TextSensor();
|
explicit TextSensor();
|
||||||
|
|
Loading…
Reference in a new issue