Skip to content

Commit

Permalink
feat(shelly): Add logs for http_requests
Browse files Browse the repository at this point in the history
  • Loading branch information
Xavier Berger committed Oct 24, 2024
1 parent 67b4188 commit 7dae064
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions solar_router/power_meter_shelly_em.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ script:
capture_response: true
on_response:
then:
- logger.log:
format: 'Response status: %d, Duration: %u ms'
args:
- response->status_code
- response->duration_ms
- lambda: |-
json::parse_json(body, [](JsonObject root) -> bool {
id(real_power).publish_state(root["power"].as< float >());
Expand Down

0 comments on commit 7dae064

Please sign in to comment.