42constexpr uint32_t ONEWAY_KEY_ADOPTION_AUTO_OFF_MS = 10 * 60 * 1000;
43constexpr const char *ONEWAY_KEY_ADOPTION_TIMEOUT_NAME =
"oneway_key_adoption_auto_off";
56 if (this->armed_callback_)
57 this->armed_callback_(
false);
66 "1W key adoption: ARMED for 10 minutes. Trigger the key-copy gesture on your existing 1W remote now "
67 "(the remote-to-remote copy mode described in its manual). Receive-only — nothing is transmitted.");
69 this->schedule_auto_off_(ONEWAY_KEY_ADOPTION_TIMEOUT_NAME, ONEWAY_KEY_ADOPTION_AUTO_OFF_MS, [
this]() {
74 ESP_LOGW(
detail::TAG,
"1W key adoption: window expired, no add-controller frame seen. Disarming.");
78 if (this->armed_callback_)
79 this->armed_callback_(
true);
92 this->observed_class_.valid =
true;
106 ESP_LOGW(
detail::TAG,
"1W key adoption: heard an add-controller frame from %s but could not decode it (error %u)",
114 const bool observed_known =
127 ESP_LOGW(
detail::TAG,
"========================================");
128 ESP_LOGW(
detail::TAG,
"1W CONTROLLER KEY ADOPTED FROM %s -- DO NOT SHARE THIS KEY",
132 ESP_LOGW(
detail::TAG,
"========================================");
void try_adopt(const IoFrame &frame)
Decode an inbound CMD_ONEWAY_ADD_CONTROLLER (0x30) while armed, report the result,...
bool armed() const
Whether the listener is currently armed.
void set_armed(bool armed)
Arm or disarm the 1W controller-key adoption listener.
void record_observed_class(const OneWayFrameInfo &info)
Remember the most recent 1W target device class observed from info.src, for the adoption report's io_...
Internal helpers shared by the hub implementation .cpp files.
constexpr const char * TAG
Shared log tag for hub-level messages.
void log_multiline_result(const char *tag, bool is_warning, const std::string &prefix, const std::string &message)
Log prefix followed by message, one line per log call rather than one call for the whole (possibly mu...
std::string build_oneway_adoption_report(const OneWayAdoptedKey &adopted, bool observed_type_known, DeviceType observed_type)
Build the full 1W controller-key-adoption report: MAC-verification status, the own-address transmissi...
static constexpr uint8_t NODE_ID_SIZE
Device/node addresses are 3 bytes (e.g., "123ABC").
DeviceType
Device type identifiers reported by IO‑Homecontrol products.
@ UNKNOWN
Unknown/unspecified device.
OneWayAddControllerDecodeError decode_1w_add_controller(const IoFrame &frame, OneWayAdoptedKey &out)
Decode a CMD_ONEWAY_ADD_CONTROLLER (0x30) frame into a recovered controller identity.
OneWayAddControllerDecodeError
Decoding outcome for decode_1w_add_controller().
@ NONE
Decode succeeded; out is populated.
static constexpr uint8_t CMD_ONEWAY_ADD_CONTROLLER
1W "add controller" — a 1W device broadcasts this while its key-copy gesture is active,...
std::string node_id_to_string(const uint8_t id[NODE_ID_SIZE])
Format a 3‑byte node ID as a 6‑character uppercase hex string.
Opt-in, receive-only adoption of a 1W installation's controller key.
Device-name, address-classification and 1W-frame codecs.
Parsed IO‑Homecontrol frame (CTRL0/1 + addresses + command + data).
uint8_t src[NODE_ID_SIZE]
Source node ID (3 bytes).
Recovered controller identity from a decoded CMD_ONEWAY_ADD_CONTROLLER (0x30) frame.
uint8_t sender_node[NODE_ID_SIZE]
Sender's node address (frame.src) — the new identity's node.
Decoded representation of a 1W remote frame.
DeviceType target_type
Target device class from broadcast address.
uint8_t src[NODE_ID_SIZE]
Remote source node ID (3 bytes).
Most recent 1W target device class observed while armed.