Add select entities and implement template select (#2067)

Co-authored-by: Otto Winter <otto@otto-winter.com>
This commit is contained in:
Jesse Hills
2021-08-02 20:00:51 +12:00
committed by GitHub
parent 69c7cf783e
commit 76991cdcc4
35 changed files with 1053 additions and 0 deletions
+6
View File
@@ -59,6 +59,12 @@ void Controller::setup_controller() {
obj->add_on_state_callback([this, obj](float state) { this->on_number_update(obj, state); });
}
#endif
#ifdef USE_SELECT
for (auto *obj : App.get_selects()) {
if (!obj->is_internal())
obj->add_on_state_callback([this, obj](const std::string &state) { this->on_select_update(obj, state); });
}
#endif
}
} // namespace esphome