Skip to content

Commit

Permalink
ESPHome Svitlo Bot (Shadow) v3.5.7
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewjswan committed Jul 8, 2024
1 parent 2e5c443 commit 9a3c6e7
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion svitlobot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ substitutions:
name: "esp-svitlobot"
friendly_name: "Svitlo Bot"
project_name: "ajs.svitlobot"
project_version: "3.5.5"
project_version: "3.5.7"
comment: "ESPHome Svitlo Bot (Shadow)"

esphome:
Expand Down Expand Up @@ -72,6 +72,11 @@ globals:
restore_value: no
initial_value: '0'

- id: session
type: bool
restore_value: no
initial_value: 'false'

script:
- id: send_state
then:
Expand All @@ -81,6 +86,9 @@ script:
- wifi.connected:
- lambda: 'return id(my_key).has_state();'
then:
- globals.set:
id: session
value: 'true'
- http_request.get:
url: !lambda |-
return ((std::string) "https://api.svitlobot.in.ua/channelPing?channel_key=" + id(my_key).state).c_str();
Expand All @@ -99,7 +107,15 @@ script:
id(send_status).publish_state(false);
id(error)++;
}
id(session) = false;
- component.update: quality
- lambda: |-
if (id(session))
{
id(send_status).publish_state(false);
id(error)++;
}
id(session) = false;
mode: queued

shadow:
Expand Down

0 comments on commit 9a3c6e7

Please sign in to comment.