Skip to content

Commit

Permalink
Merge pull request #16 from ApolloAutomation/SleepFix
Browse files Browse the repository at this point in the history
Sleep fix
  • Loading branch information
TrevorSchirmer authored Nov 12, 2024
2 parents c864bb0 + 9e6fd12 commit 8d86fc1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion Integrations/ESPHome/Core.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
substitutions:
version: "24.11.9.1"
version: "24.11.11.1"

esp32:
board: esp32-c3-devkitm-1
Expand All @@ -17,6 +17,7 @@ api:
reboot_timeout: 0s
on_client_connected:
then:
- delay: 5s
- if:
condition:
or:
Expand All @@ -27,8 +28,10 @@ api:
ESP_LOGW("Apollo", "Preventing Deep Sleep Due To OTA Or Switch");
id(deep_sleep_1).prevent_deep_sleep();
else:
- delay: 10s
- lambda: |-
id(reportAllValues).execute();
- delay: 5s
- deep_sleep.enter:
id: deep_sleep_1

Expand Down
3 changes: 2 additions & 1 deletion Integrations/ESPHome/PLT-1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ esphome:
- priority: 800.0
then:
- lambda: |-
id(deep_sleep_1).set_sleep_duration(id(deep_sleep_sleep_duration).state * 60 * 60 * 1000);
id(deep_sleep_1).set_sleep_duration(id(deep_sleep_sleep_duration).state * 60 * 1000);
id(deep_sleep_1).set_run_duration(90 * 1000);
- if:
condition:
or:
Expand Down
1 change: 1 addition & 0 deletions Integrations/ESPHome/PLT-1B.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ esphome:
then:
- lambda: |-
id(deep_sleep_1).set_sleep_duration(id(deep_sleep_sleep_duration).state * 60 * 60 * 1000);
id(deep_sleep_1).set_run_duration(90 * 1000);
- if:
condition:
or:
Expand Down
1 change: 1 addition & 0 deletions Integrations/ESPHome/PLT-1B_BLE.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ esphome:
then:
- lambda: |-
id(deep_sleep_1).set_sleep_duration(id(deep_sleep_sleep_duration).state * 60 * 60 * 1000);
id(deep_sleep_1).set_run_duration(90 * 1000);
- if:
condition:
or:
Expand Down
3 changes: 2 additions & 1 deletion Integrations/ESPHome/PLT-1_BLE.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ esphome:
priority: 500
then:
- lambda: |-
id(deep_sleep_1).set_sleep_duration(id(deep_sleep_sleep_duration).state * 60 * 60 * 1000);
id(deep_sleep_1).set_sleep_duration(id(deep_sleep_sleep_duration).state * 60 * 1000);
id(deep_sleep_1).set_run_duration(90 * 1000);
- if:
condition:
or:
Expand Down

0 comments on commit 8d86fc1

Please sign in to comment.