add SUB_TEXT_SENSOR macro (#4448)

This commit is contained in:
Regev Brody 2023-02-19 21:11:24 +02:00 committed by GitHub
parent 77db8c8401
commit 12bef16d54
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 {
public:
explicit TextSensor();