mirror of
https://github.com/esphome/esphome.git
synced 2025-10-13 23:33:48 +01:00
Update test
This commit is contained in:
@@ -15,7 +15,8 @@ esphome:
|
|||||||
data:
|
data:
|
||||||
entity_id: weather.forecast_home
|
entity_id: weather.forecast_home
|
||||||
type: hourly
|
type: hourly
|
||||||
on_response:
|
capture_response: true
|
||||||
|
on_success:
|
||||||
- lambda: |-
|
- lambda: |-
|
||||||
JsonObject next_hour = response["response"]["weather.forecast_home"]["forecast"][0];
|
JsonObject next_hour = response["response"]["weather.forecast_home"]["forecast"][0];
|
||||||
float next_temperature = next_hour["temperature"].as<float>();
|
float next_temperature = next_hour["temperature"].as<float>();
|
||||||
@@ -28,11 +29,20 @@ esphome:
|
|||||||
data:
|
data:
|
||||||
entity_id: weather.forecast_home
|
entity_id: weather.forecast_home
|
||||||
type: hourly
|
type: hourly
|
||||||
|
capture_response: true
|
||||||
response_template: "{{ response['weather.forecast_home']['forecast'][0]['temperature'] }}"
|
response_template: "{{ response['weather.forecast_home']['forecast'][0]['temperature'] }}"
|
||||||
on_response:
|
on_success:
|
||||||
- lambda: |-
|
- lambda: |-
|
||||||
float temperature = response["response"].as<float>();
|
float temperature = response["response"].as<float>();
|
||||||
ESP_LOGD("main", "Next hour temperature: %f", temperature);
|
ESP_LOGD("main", "Next hour temperature: %f", temperature);
|
||||||
|
- homeassistant.action:
|
||||||
|
action: light.toggle
|
||||||
|
data:
|
||||||
|
entity_id: light.demo_light
|
||||||
|
on_success:
|
||||||
|
- logger.log: "Toggled demo light"
|
||||||
|
on_error:
|
||||||
|
- logger.log: "Failed to toggle demo light"
|
||||||
|
|
||||||
api:
|
api:
|
||||||
port: 8000
|
port: 8000
|
||||||
|
Reference in New Issue
Block a user