Add Number entities (from Home Assistant) (#1971)

Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
This commit is contained in:
Jesse HillsandOxan van Leeuwen authored and GitHub committed 2021-07-13 07:20:12 +12:00
1 parent 1f5c79bd17
commit dd37a4e04c
36 files changed
+1206

No files matched your search

+6
View File
@@ -53,6 +53,12 @@ void Controller::setup_controller() {
obj->add_on_state_callback([this, obj]() { this->on_climate_update(obj); });
}
#endif
#ifdef USE_NUMBER
for (auto *obj : App.get_numbers()) {
if (!obj->is_internal())
obj->add_on_state_callback([this, obj](float state) { this->on_number_update(obj, state); });
}
#endif
}
} // namespace esphome