mirror of
https://github.com/esphome/esphome.git
synced 2026-09-20 03:28:41 +00:00
[remote_base] List the valid protocol names in the request_protocol error
This commit is contained in:
@@ -145,7 +145,9 @@ _PROTOCOL_STEMS = sorted(
|
||||
def request_protocol(name: str) -> None:
|
||||
"""Keep a protocol's source file in the build; components using it from C++ must call this."""
|
||||
if _protocol_stem(name) not in _PROTOCOL_STEMS:
|
||||
raise ValueError(f"Unknown remote protocol {name!r}")
|
||||
raise ValueError(
|
||||
f"Unknown remote protocol {name!r}; expected one of {', '.join(_PROTOCOL_STEMS)}"
|
||||
)
|
||||
cg.add_define(protocol_define(name))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user