Home IO Control
ESPHome add-on for IO-Homecontrol devices
Loading...
Searching...
No Matches
management_actions.cpp File Reference

Hub-level management actions such as device rename, identify, and force-open. More...

#include "management_actions.h"
#include "entity_helpers.h"
#include "hub_core.h"
#include "log_helpers.h"
#include "proto_commands.h"
#include "proto_device_types.h"
#include "roll_call.h"
#include "esphome/core/application.h"
#include "esphome/core/hal.h"
#include <algorithm>
#include <array>
#include <cctype>
#include <cerrno>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <limits>
#include <map>
#include <span>
#include <type_traits>
#include <vector>
Include dependency graph for management_actions.cpp:

Go to the source code of this file.

Classes

struct  esphome::home_io_control::HeatingNamedValue
 A value token that maps to a fixed float (used by set_mode / set_presence / set_open_window_detection). More...

Namespaces

namespace  esphome
namespace  esphome::home_io_control
namespace  esphome::home_io_control::detail

Typedefs

using esphome::home_io_control::ScanKeys = std::vector<std::array<uint8_t, AES_KEY_SIZE>>
 The keys one scan sweeps with: slot 0 is the hub key, the rest are the distinct per-device keys.

Functions

static std::string esphome::home_io_control::normalize_device_id_argument (const std::string &device_id)
static std::string esphome::home_io_control::bool_to_string (bool value)
static std::string esphome::home_io_control::format_hex_byte (uint8_t value)
 Format a byte as two uppercase hex digits, no prefix.
static ManagementActionResult esphome::home_io_control::make_management_result (const std::string &action, const std::string &device_id)
static bool esphome::home_io_control::apply_error_response (const IoFrame &response, ManagementActionResult &result)
 Decode a CMD_ERROR_RESP frame's result code into result.
static bool esphome::home_io_control::parse_probe_index (const std::string &text, uint8_t &out)
 Parse a probe_device()/probe_sweep() index argument into a byte.
static std::string esphome::home_io_control::normalize_lower_argument (const std::string &value)
 Lowercase + ASCII-trim a native-API string argument.
static bool esphome::home_io_control::match_heating_named_value (const std::string &token, const HeatingNamedValue *table, size_t table_len, float &out)
 Match token against table; on a hit set out and return true.
static bool esphome::home_io_control::parse_heating_temperature (const std::string &value, float &value_out, std::string &error)
 Parse set_temperature's value into degrees Celsius, range-checked.
static bool esphome::home_io_control::parse_heating_arguments (const std::string &function, const std::string &value, HeatingFunction &fn_out, float &value_out, std::string &error)
 Parse the (function, value) argument pair of the heating_control action.
static ScanKeys esphome::home_io_control::collect_scan_keys (const uint8_t *hub_key, DeviceRegistry &registry)
 Collect the keys to sweep: the hub key, then each per-device key that differs from it and from every key already collected.
static size_t esphome::home_io_control::count_devices_using_key (DeviceRegistry &registry, const uint8_t *hub_key, const uint8_t *key)
 How many registered devices exchange with key: those with it as their own key, or, for the hub key, those with no key of their own (or one equal to the hub's).
static std::string esphome::home_io_control::build_scan_report (const ScanState &state, DeviceRegistry &registry, ScanPowerClasses selection, const ScanKeys &keys, bool reveal_keys)
 Build the final report: known/unknown grouping, header, the selection NOTE, and the truncation NOTE.

Detailed Description

Hub-level management actions such as device rename, identify, and force-open.

This file owns advanced management operations that are not part of the normal entity surface. Operations are exposed as ESPHome native API actions so Home Assistant can trigger them without adding always-visible helper entities. All actions share one API service descriptor (detail::ManagementServiceDescriptor); adding a new action is a registration call, not a new descriptor class.

Definition in file management_actions.cpp.