[remote_base] List the hob2hood, nexus and onkyori protocol defines in defines.h (#20577)

This commit is contained in:
J. Nick Koston
2026-10-12 07:28:33 -04:00
committed by GitHub
parent c0d4287c6e
commit 3c88d39192
2 changed files with 23 additions and 0 deletions
+3
View File
@@ -169,6 +169,7 @@
#define USE_REMOTE_PROTOCOL_DYSON
#define USE_REMOTE_PROTOCOL_GOBOX
#define USE_REMOTE_PROTOCOL_HAIER
#define USE_REMOTE_PROTOCOL_HOB2HOOD
#define USE_REMOTE_PROTOCOL_JVC
#define USE_REMOTE_PROTOCOL_KEELOQ
#define USE_REMOTE_PROTOCOL_LG
@@ -177,6 +178,8 @@
#define USE_REMOTE_PROTOCOL_MIRAGE
#define USE_REMOTE_PROTOCOL_NEC
#define USE_REMOTE_PROTOCOL_NEXA
#define USE_REMOTE_PROTOCOL_NEXUS
#define USE_REMOTE_PROTOCOL_ONKYORI
#define USE_REMOTE_PROTOCOL_PANASONIC
#define USE_REMOTE_PROTOCOL_PIONEER
#define USE_REMOTE_PROTOCOL_PRONTO
@@ -0,0 +1,20 @@
"""Every gated protocol source needs its define listed for static analysis."""
from pathlib import Path
from esphome.components.remote_base import _PROTOCOL_STEMS, protocol_define
DEFINES_H = Path(__file__).parents[4] / "esphome" / "core" / "defines.h"
def test_every_protocol_define_is_listed_in_defines_h() -> None:
"""A protocol compiled only behind its define would drop out of clang-tidy without this line."""
defines = DEFINES_H.read_text(encoding="utf-8")
missing = [
stem
for stem in _PROTOCOL_STEMS
if f"#define {protocol_define(stem)}\n" not in defines
]
assert not missing, (
f"Add #define {', '.join(protocol_define(s) for s in missing)} to {DEFINES_H.name}"
)