From 55ecd9b28f16a5684a042b07f55e5ecc75cdd5e6 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 14 Oct 2026 19:58:00 -1000 Subject: [PATCH] Drop the trailing underscore from the static opcode check and note that send_as only sends --- esphome/components/hdmi_cec/hdmi_cec.cpp | 10 +++++----- esphome/components/hdmi_cec/hdmi_cec.h | 2 +- tests/components/hdmi_cec/common.yaml | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/esphome/components/hdmi_cec/hdmi_cec.cpp b/esphome/components/hdmi_cec/hdmi_cec.cpp index e29ceba2f3c..666ded906ce 100644 --- a/esphome/components/hdmi_cec/hdmi_cec.cpp +++ b/esphome/components/hdmi_cec/hdmi_cec.cpp @@ -117,11 +117,11 @@ void HDMICEC::loop() { #ifdef HDMI_CEC_MESSAGE_CALLBACK_COUNT this->message_callbacks_.call(frame->initiator_addr(), frame->destination_addr(), frame->payload()); #endif - // Only a frame directed at us from a registered device gets a reply: a broadcast is never - // answered, a device that only listens (address 0xF) has nothing to say, and an unregistered - // initiator cannot be answered directly + // Only a frame directed at us from a registered device gets a built-in reply: a broadcast is + // never answered (so an instance on the unregistered address 0xF answers nothing, though it may + // still send), and an unregistered initiator cannot be answered directly if (!this->monitor_mode_ && !frame->is_broadcast() && frame->destination_addr() == this->address_ && - frame->initiator_addr() != Frame::BROADCAST_ADDRESS && !is_claimed_(frame->payload()[0])) { + frame->initiator_addr() != Frame::BROADCAST_ADDRESS && !is_claimed(frame->payload()[0])) { this->reply_builtin_(frame); } this->frames_queue_.pop_front(); @@ -135,7 +135,7 @@ void HDMICEC::loop() { } } -bool HDMICEC::is_claimed_(uint8_t opcode) { +bool HDMICEC::is_claimed(uint8_t opcode) { #ifdef HDMI_CEC_CLAIMED_OPCODE_COUNT for (uint8_t i = 0; i < HDMI_CEC_CLAIMED_OPCODE_COUNT; i++) { if (progmem_read_byte(&CLAIMED_OPCODES[i]) == opcode) { diff --git a/esphome/components/hdmi_cec/hdmi_cec.h b/esphome/components/hdmi_cec/hdmi_cec.h index 49a96755219..165e8d64cc9 100644 --- a/esphome/components/hdmi_cec/hdmi_cec.h +++ b/esphome/components/hdmi_cec/hdmi_cec.h @@ -178,7 +178,7 @@ class HDMICEC : public Component { /// The built-in replies to a frame directed at us that no automation claims void reply_builtin_(const Frame *frame); - static bool is_claimed_(uint8_t opcode); + static bool is_claimed(uint8_t opcode); // Transmit side, in loop() void transmit_message_(); diff --git a/tests/components/hdmi_cec/common.yaml b/tests/components/hdmi_cec/common.yaml index 6c0a3fccf91..ba750959821 100644 --- a/tests/components/hdmi_cec/common.yaml +++ b/tests/components/hdmi_cec/common.yaml @@ -15,7 +15,7 @@ hdmi_cec: then: - lambda: |- id(cec).send(0xf, {0x87, 0x00, 0x09, 0xb0}); - - opcode: 0x9F # Get CEC Version, asked of the playback device we also stand in for + - opcode: 0x9F # Get CEC Version, asked of a playback device we send for (frames to it are not acknowledged) destination: 0x4 then: - hdmi_cec.send_as: