[entity_transport] Find an addressing peer's layers for the timeout check

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
clydebarrow
2026-10-20 08:41:59 +11:00
co-authored by Claude Opus 5.5
parent 28c32cf1f6
commit d0007eb062
+27
View File
@@ -79,6 +79,33 @@ def test_timeout_not_with_session(setup_core, layers: dict, allowed: bool) -> No
fv.full_config.reset(token)
def test_timeout_not_with_session_on_peer(setup_core) -> None:
"""The layers of an addressing peer are found by the peer's id."""
peers = [
{CONF_ID: ID("plain", is_manual=True)},
{CONF_ID: ID("with_session", is_manual=True), "session": {}},
]
token = fv.full_config.set(
{
"packet_interface": [
{CONF_ID: ID("bus", is_manual=True), "addressing": {"peers": peers}}
]
}
)
try:
FINAL_VALIDATE_SCHEMA(
CONFIG_SCHEMA({"packet_interface": "plain", CONF_TIMEOUT: "1min"})
)
with pytest.raises(cv.Invalid, match="session"):
FINAL_VALIDATE_SCHEMA(
CONFIG_SCHEMA(
{"packet_interface": "with_session", CONF_TIMEOUT: "1min"}
)
)
finally:
fv.full_config.reset(token)
def test_advertised_ids_unique(setup_core) -> None:
"""Two entities of one type cannot be sent with the same id."""
base = {"packet_interface": "link"}