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

Device-type capabilities, packed-metadata decoding and position reports. More...

#include "proto_device_model.h"
#include "proto_heating_profiles.h"
#include "proto_constants.h"
#include "proto_device_types.h"
#include <cmath>
#include <cstdio>
#include <cstring>
Include dependency graph for proto_device_model.cpp:

Go to the source code of this file.

Namespaces

namespace  esphome
namespace  esphome::home_io_control

Functions

bool esphome::home_io_control::default_inverted_for_type (DeviceType type)
 Determine whether a device type has inverted position mapping by default.
const char * esphome::home_io_control::rain_sensor_state_name (RainSensorState state)
 Get a human-readable name for a RainSensorState.
const char * esphome::home_io_control::battery_state_name (BatteryState state)
 Get the name a battery level is published under.
BatteryState esphome::home_io_control::decode_battery_state (uint8_t status_byte)
 Decode the coarse battery level from byte 1 of a status payload (CMD_PRIVATE_RESP to a status poll, or CMD_STATUS_UPDATE).
const char * esphome::home_io_control::cover_command_name (CoverCommand cmd)
 Get a human-readable name for a CoverCommand.
DeviceType esphome::home_io_control::decode_packed_device_type (uint8_t type_msb, uint8_t type_subtype)
 Decode the 10-bit node type from two packed metadata bytes.
uint8_t esphome::home_io_control::decode_packed_device_subtype (uint8_t type_subtype)
 Decode a protocol-packed device subtype from the second metadata byte.
void esphome::home_io_control::encode_packed_device_type (DeviceType type, uint8_t subtype, uint8_t &type_msb, uint8_t &type_subtype)
 Encode a DeviceType/subtype pair into the two-byte packed metadata format used by discovery responses — the inverse of decode_packed_device_type()/decode_packed_device_subtype().
void esphome::home_io_control::decode_position_report (uint16_t target_raw, uint16_t current_raw, bool is_stopped, float &target, float &position)
 Decode target/current position values from a status frame.
bool esphome::home_io_control::has_reached_target_position (float target, float position)
 Has the device reached its target within tolerance?
float esphome::home_io_control::decode_tilt_report (uint16_t tilt_raw)
 Decode tilt angle from raw 16‑bit value.
bool esphome::home_io_control::is_known_device_type (uint16_t raw)
 True when a raw 10-bit device-type value is a named DeviceType enumerator.
const char * esphome::home_io_control::device_type_name (DeviceType type)
 Convert a DeviceType to a lowercase string identifier.
const char * esphome::home_io_control::yaml_device_type_name (DeviceType type)
 Return the YAML-friendly device-type name for types exposed in the Python schema.
DeviceCapabilityClass esphome::home_io_control::device_capability_class (DeviceType type)
 Map a raw IO‑Homecontrol type to the closest ESPHome/Home Assistant entity family.
const char * esphome::home_io_control::device_capability_class_name (DeviceType type)
 Get a human‑readable name for a capability class.
bool esphome::home_io_control::device_supports_position_control (DeviceType type)
 Does this device type support precise position control (0–100)?
bool esphome::home_io_control::device_supports_binary_control (DeviceType type)
 Does this device type support binary on/off control?
bool esphome::home_io_control::device_supports_lock_control (DeviceType type)
 Does this device type support binary lock/unlock control via execute commands?
bool esphome::home_io_control::device_supports_heat_level_control (DeviceType type)
 Does this device take a heat level as its position (exterior heating)?
bool esphome::home_io_control::device_has_no_motion (DeviceType type, uint8_t subtype)
 Does this device never move, so a status reply must not start the movement settle loop?
bool esphome::home_io_control::device_supports_climate_control (DeviceType type, uint8_t subtype)
 Can a climate entity drive this device?
bool esphome::home_io_control::device_supports_status_requests (DeviceType type)
 Does this device type support status request commands (0x03)?
bool esphome::home_io_control::device_supports_tilt (DeviceType type)
 Does this device type support tilt (slat angle) control?
bool esphome::home_io_control::device_takes_main_parameter_only (DeviceType type, uint8_t subtype)
 Does this device take movement commands as the main parameter only?
bool esphome::home_io_control::device_supports_vent (DeviceType type)
 Does this device type support the ventilation position command?
const char * esphome::home_io_control::device_operation_profile_name (DeviceType type)
 Human‑readable operation profile name for a device type.
std::string esphome::home_io_control::format_device_type_diagnostic (DeviceType type)
 Human-readable device type string for diagnostics, including the raw numeric value.
std::string esphome::home_io_control::format_device_type_for_yaml (DeviceType type)
 Build the YAML value for a device's io_device_type key.
std::string esphome::home_io_control::build_device_yaml_snippet (DeviceType type, uint8_t subtype, const std::string &device_id, bool metadata_complete, bool inverted, bool low_power, const std::string &system_key_hex=std::string())
 Build the ready-to-paste YAML block describing a device, for both a fully-decoded device and one whose type/subtype wasn't reported.

Detailed Description

Device-type capabilities, packed-metadata decoding and position reports.

Definition in file proto_device_model.cpp.