From 57023457ee08625ac96d13272fd9a398f3aa901e Mon Sep 17 00:00:00 2001 From: Regev Brody Date: Mon, 29 May 2023 00:44:05 +0300 Subject: [PATCH] add SUB_SELECT macro (#4897) --- esphome/components/select/select.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/esphome/components/select/select.h b/esphome/components/select/select.h index 23258d5785..8ca9a69d1c 100644 --- a/esphome/components/select/select.h +++ b/esphome/components/select/select.h @@ -17,6 +17,13 @@ namespace select { } \ } +#define SUB_SELECT(name) \ + protected: \ + select::Select *name##_select_{nullptr}; \ +\ + public: \ + void set_##name##_select(select::Select *select) { this->name##_select_ = select; } + /** Base-class for all selects. * * A select can use publish_state to send out a new value.