mirror of
https://github.com/esphome/esphome.git
synced 2026-10-18 04:02:54 +00:00
[api] Test api.connected without options and with a lambda (#20835)
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user