6 namespace display_menu_base {
11 return LOG_STR(
"MENU_ITEM_LABEL");
13 return LOG_STR(
"MENU_ITEM_MENU");
15 return LOG_STR(
"MENU_ITEM_BACK");
17 return LOG_STR(
"MENU_ITEM_SELECT");
19 return LOG_STR(
"MENU_ITEM_NUMBER");
21 return LOG_STR(
"MENU_ITEM_SWITCH");
23 return LOG_STR(
"MENU_ITEM_COMMAND");
25 return LOG_STR(
"MENU_ITEM_CUSTOM");
27 return LOG_STR(
"UNKNOWN");
41 if (this->value_getter_.has_value()) {
42 result = this->value_getter_.value()(
this);
44 if (this->select_var_ !=
nullptr) {
45 result = this->select_var_->state;
55 if (this->select_var_ !=
nullptr) {
56 this->select_var_->make_call().select_next(
true).perform();
66 if (this->select_var_ !=
nullptr) {
67 this->select_var_->make_call().select_previous(
true).perform();
79 if (this->value_getter_.has_value()) {
80 result = this->value_getter_.value()(
this);
83 snprintf(data,
sizeof(data), this->format_.c_str(), get_number_value_());
93 if (this->number_var_ !=
nullptr) {
94 float last = this->number_var_->state;
95 this->number_var_->make_call().number_increment(
false).perform();
97 if (this->number_var_->state != last) {
107 bool changed =
false;
109 if (this->number_var_ !=
nullptr) {
110 float last = this->number_var_->state;
111 this->number_var_->make_call().number_decrement(
false).perform();
113 if (this->number_var_->state != last) {
125 if (this->number_var_ !=
nullptr) {
126 if (!this->number_var_->has_state() || this->number_var_->state < this->number_var_->traits.get_min_value()) {
127 result = this->number_var_->traits.get_min_value();
128 }
else if (this->number_var_->state > this->number_var_->traits.get_max_value()) {
129 result = this->number_var_->traits.get_max_value();
131 result = this->number_var_->state;
143 if (this->value_getter_.has_value()) {
144 result = this->value_getter_.value()(
this);
146 result = this->get_switch_state_() ? this->switch_on_text_ : this->switch_off_text_;
159 bool changed =
false;
161 if (this->switch_var_ !=
nullptr) {
162 this->switch_var_->toggle();
172 return (this->value_getter_.has_value()) ? this->value_getter_.value()(
this) :
"";
bool select_prev() override
bool select_next() override
Implementation of SPI Controller mode.