From 5df6c65cc249adef35af836f089eb7a5a91f4fa8 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 17 Oct 2026 15:23:35 -1000 Subject: [PATCH] [api] Test api.connected without options and with a lambda (#20835) --- tests/components/api/common-base.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/components/api/common-base.yaml b/tests/components/api/common-base.yaml index 7f6cb83f16c..e64ba88f112 100644 --- a/tests/components/api/common-base.yaml +++ b/tests/components/api/common-base.yaml @@ -5,6 +5,17 @@ esphome: condition: api.connected: state_subscription_only: true + - if: + condition: + api.connected: + then: + - logger.log: "API client connected" + - if: + condition: + api.connected: + state_subscription_only: !lambda "return true;" + then: + - logger.log: "API client subscribed to states" - homeassistant.event: event: esphome.button_pressed data: