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

Helpers shared only by the hub's own implementation files (hub_*.cpp). More...

#include "hub_core.h"
#include "entity_helpers.h"
#include "log_frame.h"
#include "log_helpers.h"
#include "proto_codecs.h"
#include "esphome/core/log.h"
#include <algorithm>
#include <array>
#include <cstdio>
#include <cstring>
#include <map>
#include <string>
#include <vector>
Include dependency graph for hub_internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

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

Functions

bool esphome::home_io_control::detail::is_binary_entity_position (uint8_t position)
 Is the given position value an on/off binary encoding?
bool esphome::home_io_control::detail::known_device_matches_entity_class (const IoDevice &dev, DeviceCapabilityClass expected)
 Does the device's type match the expected HA entity class?
bool esphome::home_io_control::detail::known_device_supports_status_requests (const IoDevice &dev)
 Does the device support status requests?
bool esphome::home_io_control::detail::known_device_accepts_execute_position (const IoDevice &dev, uint8_t position)
 Can this device accept an execute (position) command?
bool esphome::home_io_control::detail::known_device_accepts_execute_tilt (const IoDevice &dev)
 Can this device accept a tilt command?
void esphome::home_io_control::detail::log_rejected_operation (const std::string &device_id, const IoDevice &dev, const char *operation, const char *expected)
 Log a rejected operation with capability mismatch details.
void esphome::home_io_control::detail::log_frame_issue (IOHomeControlComponent *component, const char *direction, const char *reason, const IoFrame &frame, uint8_t len)
 Log a frame‑level issue (unregistered endpoints, unsupported commands).
void esphome::home_io_control::detail::log_1w_remote_frame (const OneWayFrameInfo &info, const std::vector< std::string > *linked_devices=nullptr)
 Log an already-decoded 1W remote frame at DEBUG level.
bool esphome::home_io_control::detail::is_exposed_sender (const std::vector< std::string > &exposed_senders, const std::string &sender_id)
 Whether a 1W sender is on the exposed_senders allowlist for the sender HA event.
std::string esphome::home_io_control::detail::describe_learned_device_type (DeviceType type)
 Build the YAML line to add once a device's type is learned at runtime.
std::map< std::string, std::string > esphome::home_io_control::detail::build_sender_event_data (const OneWayFrameInfo &info, bool linked)
 Build the Home Assistant event data map for a decoded 1W sender frame.
void esphome::home_io_control::detail::normalize_stopped_state (IoDevice &dev)
 Normalize stopped state: some devices briefly report stopped before target/current converge.
void esphome::home_io_control::detail::update_link_health (IoDevice &dev, RadioDriver *radio)
 Update per-device link-health stats from the radio's last capture.
void esphome::home_io_control::detail::record_exchange_timeout (IoDevice &dev, uint8_t tries)
 Record that an outbound exchange to this device timed out (no valid response).
void esphome::home_io_control::detail::record_exchange_outcome (IoDevice &dev, uint8_t request_cmd, ExchangeOutcome outcome)
 Record what an outbound exchange's ending says about the device, whichever way the caller then classifies the outcome.
void esphome::home_io_control::detail::apply_last_command_record (IoDevice &dev, const LastCommandRecord &record)
 Store a decoded record on the device, if it is valid.
std::string esphome::home_io_control::detail::describe_status_update_originator (const IoFrame &frame)
 Describe a 0x71 status update's Command Originator as "name(0xXX)".
std::string esphome::home_io_control::detail::describe_prediction (const IoDevice &dev)
 Describe the hub's live optimistic predictions where they disagree with the observation.
void esphome::home_io_control::detail::log_status_update (const std::string &id, const IoDevice &dev, const char *suffix="")
 Log a concise status‑update line used by inbound handlers.
void esphome::home_io_control::detail::log_command_result (const std::string &id, uint8_t result, uint8_t request_cmd=0, bool include_request_cmd=false)
 Log a decoded CMD_ERROR_RESP result with optional request-command context.
void esphome::home_io_control::detail::record_command_result (IoDevice &dev, const std::string &id, uint8_t result, uint8_t request_cmd=0, bool include_request_cmd=false)
 Store a decoded CMD_ERROR_RESP result on the device and log it.
void esphome::home_io_control::detail::clear_command_result (IoDevice &dev)
 Clear a previously recorded CMD_ERROR_RESP result, if any.

Variables

constexpr uint32_t esphome::home_io_control::detail::ONEWAY_DEDUP_WINDOW_MS = 2000
 Suppress a repeated 1W log/poll for the same remote and the same intent within this window.
constexpr const char * esphome::home_io_control::detail::ONEWAY_SENDER_EVENT = "esphome.home_io_control_sender_event"
 Home Assistant event fired when a decoded 1W frame carries a command intent from an exposed sender (a physical remote button press, or a wind/rain sensor's triggered command).
constexpr size_t esphome::home_io_control::detail::LEARNED_DEVICE_TYPE_HEX_BUFFER_SIZE = 24
 Buffer size for describe_learned_device_type()'s hex fallback: "io_device_type: 0xXX" plus margin.

Detailed Description

Helpers shared only by the hub's own implementation files (hub_*.cpp).

Collaborators and entities include log_helpers.h / entity_helpers.h instead; make include-graph enforces this. Keeping these helpers here leaves hub_core.h focused on the public component shape and the member-function declarations.

Definition in file hub_internal.h.