Add WiFi/MQTT/API connected condition (#465)

* Add WiFi/MQTT/API connected condition

* Add tests

* Fix namespace
This commit is contained in:
Otto Winter
2019-03-03 16:45:56 +01:00
committed by GitHub
parent 8495ce96a3
commit 4b017e2096
6 changed files with 69 additions and 29 deletions

View File

@@ -185,8 +185,12 @@ text_sensor:
icon: mdi:icon
id: version_sensor
on_value:
- lambda: !lambda |-
ESP_LOGD("main", "The state is %s=%s", x.c_str(), id(version_sensor).state.c_str());
- if:
condition:
- api.connected:
then:
- lambda: !lambda |-
ESP_LOGD("main", "The state is %s=%s", x.c_str(), id(version_sensor).state.c_str());
- script.execute: my_script
- homeassistant.service:
service: notify.html5