33static constexpr uint8_t SUBTYPE_MAIN_PARAMETER_ONLY = 58;
173 return static_cast<DeviceFeatures>((type_features & ~(LEVELS | TILT | EXTENDED_POSITION_FRAME)) |
174 MAIN_PARAMETER_ONLY);
183 return static_cast<uint16_t
>((
static_cast<uint16_t
>(high) << BITS_PER_BYTE) | low);
227 if (named.command == command)
247 if (named ==
nullptr)
263 return has_feature(features, device_feature::LEVELS);
265 if (named.main_parameter == main_parameter)
277 if (position == POS_STOP)
279 if (position > POSITION_WIRE_MAX / POSITION_WIRE_SCALE)
Capability bits carried by a DeviceTypeInfo row and resolved onto a device record.
Bit flags carried by a DeviceTypeInfo row: identity facts. Capabilities are DeviceFeatures.
static constexpr uint8_t YAML_SELECTABLE
Type rows only: the type's identifier is accepted by the YAML io_device_type key (hub_validators....
static constexpr uint8_t EXPERIMENTAL
Subtype rows only: no capture or report has confirmed this kind on a real device, so what the row say...
static constexpr uint8_t HAS_PLATFORM
An ESPHome platform of the row's capability class can drive this (type, subtype).
static constexpr uint8_t STANDALONE_NAME
Subtype rows only: name already is the complete description ("window lock") and is printed alone,...
DeviceFeatures device_features(DeviceType type, uint8_t subtype, DeviceModel model)
Capability bits of a (type, subtype, model).
constexpr uint16_t main_parameter_of(uint8_t high, uint8_t low=0)
Combine the two bytes of a main parameter as the EXECUTE payload carries them.
DeviceFeatures undeclared_kind_features(DeviceCapabilityClass entity_class)
Features of a device kind that has no table row, or that is not declared at all.
std::string format_device_ids(DeviceType type, uint8_t subtype)
Wire values of a (type, subtype), for logs that must stay readable without the table.
DeviceCapabilityClass device_capability_class(DeviceType type)
Map a raw IO‑Homecontrol type to the closest ESPHome/Home Assistant entity family.
static constexpr uint16_t MAIN_PARAMETER_OPEN
Main parameter that opens (or switches off) a device: percent 0.
CoverCommand
Named device commands for cover-type actuators.
@ FAVORITE
Move to stored favorite/"My" position.
@ STOP
Stop movement immediately.
@ VENT
Move to ventilation position (window-type devices).
@ PEDESTRIAN
Move to the pedestrian position (gate openers); experimental.
@ PARTIAL
Move to the stored partial position (garage openers; issue #163).
const DeviceTypeInfo * find_device_type_info(DeviceType type, uint8_t subtype, DeviceModel model)
Look up the table row for a (type, subtype, model).
DeviceModel
A product model below a (node type, subtype): for products that report the same wire type but need di...
static constexpr uint8_t POS_PEDESTRIAN_MODIFIER
Modifier byte for the pedestrian-position command (POS_FAVORITE main byte, as for ventilation).
const DeviceTypeInfo * find_device_model_info(DeviceType type, uint8_t subtype, DeviceModel model)
Look up the model row with exactly this (type, subtype, model), without falling back.
const NamedPosition * find_named_position(CoverCommand command)
The named position a command sends.
DeviceType
IO-Homecontrol node types.
constexpr NamedPosition NAMED_POSITIONS[]
The named positions.
constexpr bool has_feature(DeviceFeatures set, DeviceFeatures bit)
True when every bit of bit is set in set.
static constexpr uint8_t SUBTYPE_HEATER_WITH_SETPOINT
Subtype of the electrical heater (node type 52) with an adjustable setpoint, the one driven over the ...
const DeviceTypeInfo * find_exact_device_type_info(DeviceType type, uint8_t subtype)
Look up the table row with exactly this (type, subtype), without falling back.
static constexpr uint16_t MAIN_PARAMETER_CLOSED
Main parameter that closes (or switches on) a device: 100 percent, the top of the position scale.
bool device_offers_models(DeviceType type, uint8_t subtype)
Does this exact (type, subtype) have model rows below it?
constexpr uint16_t position_main_parameter(uint8_t position)
The main parameter set_device_position() sends for a percent position or the POS_STOP sentinel.
constexpr DeviceFeatures main_parameter_only_variant(DeviceFeatures type_features)
The features of a subtype-58 variant of a kind.
static constexpr uint16_t MAIN_PARAMETER_STOP
Main parameter that stops a movement.
const char * device_platform_name(DeviceType type, uint8_t subtype)
Name of the ESPHome platform that drives this (type, subtype).
static constexpr uint16_t MAIN_PARAMETER_INVALID
What position_main_parameter() returns for a value that is no position; no device accepts it.
bool device_has_platform(DeviceType type, uint8_t subtype)
Can an ESPHome platform drive this (type, subtype) today?
bool device_is_experimental(DeviceType type, uint8_t subtype)
Is this (type, subtype) a kind no capture or report has confirmed on a real device?
uint16_t DeviceFeatures
Capability bits of a device kind; see device_feature.
bool command_main_parameter(CoverCommand command, uint16_t &main_parameter)
The main parameter a named command sends.
static constexpr uint8_t POS_PARTIAL_MODIFIER
Modifier byte for the partial-position command (POS_FAVORITE main byte, as for ventilation).
DeviceCapabilityClass
High‑level capability class derived from DeviceType.
constexpr bool device_accepts_main_parameter(DeviceFeatures features, uint16_t main_parameter)
True when a device with these features accepts this main-parameter value in an EXECUTE.
std::string format_device_kind(DeviceType type, uint8_t subtype)
Human-readable description of a (type, subtype) for logs and reports.
IO-Homecontrol command IDs, result codes and protocol enumerations.
Capability bits of a device kind: what a (node type, subtype) can do.
IO-Homecontrol device-type model, capabilities and runtime device state.
One row of the node-type / subtype table.
uint8_t flags
device_type_flags bits.
uint8_t subtype
Subtype; 0 is the type's own row.
DeviceFeatures features
device_feature bits: the whole word, never merged with the type row's.
const char * name
Type row: lowercase identifier ("roller_shutter").
DeviceModel model
NONE for a type or subtype row; the model of a model row.
DeviceCapabilityClass capability
Entity family the device maps to.
DeviceType type
Node type.
One named position: its feature bit, its main-parameter value and the command that sends it.
uint16_t main_parameter
Value sent as the EXECUTE main parameter.
CoverCommand command
The command that sends it.
const char * name
cover_command_name() of the command ("FAVORITE", "VENT", "PEDESTRIAN", "PARTIAL").
DeviceFeatures feature
The bit a device needs to accept it.