14using device_type_flags::BRIGHTNESS_ONLY;
15using device_type_flags::HAS_PLATFORM;
16using device_type_flags::MAIN_PARAMETER_ONLY;
17using device_type_flags::STANDALONE_NAME;
18using device_type_flags::YAML_SELECTABLE;
28constexpr uint8_t SELECTABLE_PLATFORM =
29 YAML_SELECTABLE | HAS_PLATFORM;
30constexpr uint8_t SUBTYPE_PLATFORM = HAS_PLATFORM;
32constexpr size_t TYPE_HEX_BUFFER_SIZE = 24;
63 {
DeviceType::LIGHT, 1,
"dimmable RGB", CAP_LIGHT, SUBTYPE_PLATFORM | BRIGHTNESS_ONLY},
64 {
DeviceType::LIGHT, 2,
"tunable white", CAP_LIGHT, SUBTYPE_PLATFORM | BRIGHTNESS_ONLY},
65 {
DeviceType::LIGHT, SUBTYPE_MAIN_PARAMETER_ONLY,
"on/off only", CAP_LIGHT, SUBTYPE_PLATFORM},
73 {
DeviceType::LOCK, 1,
"window lock", CAP_LOCK, SUBTYPE_PLATFORM | STANDALONE_NAME},
155 if (row.type == type && row.subtype == subtype)
168 return row !=
nullptr && (row->
flags & HAS_PLATFORM) != 0;
203 return row !=
nullptr && (row->
flags & BRIGHTNESS_ONLY) != 0;
208 if (type_row ==
nullptr) {
209 char buf[TYPE_HEX_BUFFER_SIZE];
210 snprintf(buf,
sizeof(buf),
"unknown type 0x%02X",
static_cast<unsigned>(type));
211 return subtype == 0 ? std::string(buf) : std::string(buf) +
", subtype " + std::to_string(subtype);
215 if (subtype_row !=
nullptr && (subtype_row->
flags & STANDALONE_NAME) != 0)
216 return subtype_row->
name;
219 std::string kind = type_row->
name;
220 for (
char &c : kind) {
226 return kind +
", " + (subtype_row !=
nullptr ? std::string(subtype_row->
name) :
"subtype " + std::to_string(subtype));
230 char buf[TYPE_HEX_BUFFER_SIZE];
231 snprintf(buf,
sizeof(buf),
"0x%02X/%u",
static_cast<unsigned>(type),
static_cast<unsigned>(subtype));
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.
DeviceType
IO-Homecontrol node types.
@ LOUVRE_BLIND
Louvre blind.
@ SLIDING_WINDOW
Sliding window.
@ EXTERIOR_VENETIAN_BLIND
Exterior venetian blind.
@ VERTICAL_INTERIOR_BLIND
Vertical interior blind.
@ CENTRAL_HOUSE_CONTROL
Central house control.
@ GATE_OPENER
Gate opener.
@ ELECTRICAL_HEATER
Electrical heater.
@ VERTICAL_EXTERIOR_AWNING
Vertical exterior awning.
@ HEATING_TEMPERATURE_INTERFACE
Heating temperature interface.
@ BEACON
Beacon (unpaired/announcement).
@ SECURE_CONFIGURATION_DEVICE
Secure configuration device (a commissioning tool, not an actuator).
@ INTERIOR_VENETIAN_BLIND
Interior venetian blind.
@ UNKNOWN
Unknown/unspecified device.
@ DOMESTIC_HOT_WATER
Domestic hot water.
@ ZONE_CONTROL
Zone control.
@ INTRUSION_ALARM
Intrusion alarm.
@ WINDOW_OPENER
Window opening actuator.
@ SWINGING_SHUTTER
Swinging shutter.
@ HEAT_RECOVERY_VENTILATION
Heat recovery ventilation.
@ HORIZONTAL_AWNING
Horizontal awning (open/close inverted).
@ ROLLING_DOOR_OPENER
Rolling door opener.
@ ON_OFF_SWITCH
Generic on/off switch.
@ EXTERIOR_HEATING
Exterior heating.
@ TEST_AND_EVALUATION
Test and evaluation equipment.
@ DUAL_ROLLER_SHUTTER
Dual-section roller shutter.
@ VENTILATION_POINT
Ventilation point.
@ ROLLER_SHUTTER
Roller shutter.
@ REMOTE_CONTROLLER
Remote controller (all ten type bits set, packed bytes FF C0).
@ CURTAIN_TRACK
Curtain track.
@ BIOCLIMATIC_PERGOLA
Bioclimatic pergola (louvre opening as the position).
@ GARAGE_OPENER
Garage door opener.
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.
const char * device_platform_name(DeviceType type, uint8_t subtype)
Name of the ESPHome platform that drives this (type, subtype).
bool device_has_platform(DeviceType type, uint8_t subtype)
Can an ESPHome platform drive this (type, subtype) today?
const DeviceTypeInfo * find_device_type_info(DeviceType type, uint8_t subtype)
Look up the table row for a (type, subtype) pair.
DeviceCapabilityClass
High‑level capability class derived from DeviceType.
@ CLIMATE
Climate device (heating/cooling).
@ SWITCH
Binary on/off switch.
@ UNKNOWN
Unknown capability.
@ HEATER_LEVEL
Heater with a heat level in the position field (exterior heating).
@ COVER
Position‑controlled cover (shutter/blind/awning).
@ LIGHT
Binary on/off light.
std::string format_device_kind(DeviceType type, uint8_t subtype)
Human-readable description of a (type, subtype) for logs and reports.
bool device_light_is_brightness_only(DeviceType type, uint8_t subtype)
Is this light limited to brightness (no colour, no colour temperature)?
The IO node-type and subtype table: names, entity class, platform and behaviour flags.
One row of the node-type / subtype table.
uint8_t flags
device_type_flags bits.
const char * name
Type row: lowercase identifier ("roller_shutter").
DeviceCapabilityClass capability
Entity family the device maps to.