Home IO Control
ESPHome add-on for IO-Homecontrol devices
Loading...
Searching...
No Matches

Table-driven registry of runtime tuning parameters. More...

#include "tuning_config.h"
#include <string>
Include dependency graph for tuning_registry.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  esphome::home_io_control::TuningNumberParam
 One numeric tuning parameter: its wire name plus accessors over TuningConfig. More...
struct  esphome::home_io_control::TuningSelectParam
 One select tuning parameter: its wire name plus string accessors over TuningConfig. More...

Namespaces

namespace  esphome
namespace  esphome::home_io_control

Functions

const TuningNumberParamesphome::home_io_control::find_tuning_number (const std::string &name)
 Look up a numeric tuning parameter by name; returns nullptr if unknown.
const TuningSelectParamesphome::home_io_control::find_tuning_select (const std::string &name)
 Look up a select tuning parameter by name; returns nullptr if unknown.
Table iteration

Range accessors over the full parameter tables, for enumeration and tests.

const TuningNumberParamesphome::home_io_control::tuning_number_params_begin ()
const TuningNumberParamesphome::home_io_control::tuning_number_params_end ()
const TuningSelectParamesphome::home_io_control::tuning_select_params_begin ()
const TuningSelectParamesphome::home_io_control::tuning_select_params_end ()

Detailed Description

Table-driven registry of runtime tuning parameters.

The hub exposes each tuning parameter through Home Assistant number/select entities. Rather than hand-syncing four string-dispatch functions in the hub, this registry enumerates every parameter once, as a table row pairing the parameter's wire name with getter/setter function pointers over TuningConfig. The hub's update/get methods become thin table lookups.

Adding a tuning parameter
Add exactly two things and the cross-language sync check (make tuning-sync) will keep them honest:
  1. one row in the appropriate table below (NUMBER_PARAMS or SELECT_PARAMS), and
  2. one matching entry in tuning.py (_NUMBER_PARAMS or _SELECT_OPTIONS). The parameter name string must be identical on both sides.

Definition in file tuning_registry.h.