Home IO Control
ESPHome add-on for IO-Homecontrol devices
Loading...
Searching...
No Matches
tuning_entities.cpp
Go to the documentation of this file.
1/// @file tuning_entities.cpp
2/// @brief Home Assistant `number` and `select` tuning entity implementations.
3/// @ingroup hioc_tuning
4
5#include "tuning_entities.h"
6#include "hub_core.h"
7
8namespace esphome {
9namespace home_io_control {
10
12 if (this->parent_ != nullptr)
13 this->publish_state(this->parent_->get_tuning_number_value(this->param_name_));
14}
15
17 if (this->parent_ == nullptr)
18 return;
19 const std::string value = this->parent_->get_tuning_select_value(this->param_name_);
20 if (!value.empty())
21 this->publish_state(value);
22}
23
24void IOHomeTuningNumber::control(float value) {
25 this->publish_state(value);
26 if (this->parent_ != nullptr)
27 this->parent_->update_tuning_number(this->param_name_, value);
28}
29
30void IOHomeTuningSelect::control(const std::string &value) {
31 this->publish_state(value);
32 if (this->parent_ != nullptr)
33 this->parent_->update_tuning_select(this->param_name_, value);
34}
35
36} // namespace home_io_control
37} // namespace esphome
void setup() override
Publish the current tuning value so the HA slider reflects the active configuration on boot.
void control(float value) override
Called by ESPHome when the user changes the slider value in HA.
void control(const std::string &value) override
Called by ESPHome when the user selects a new option in HA.
void setup() override
Publish the current tuning option so the HA dropdown reflects the active configuration on boot.
IO-Homecontrol ESPHome component — protocol controller.
Home Assistant number and select entities that control runtime tuning parameters.