Skip to content

Commit

Permalink
Merge pull request #11 from ApolloAutomation/FixPLT1BTest
Browse files Browse the repository at this point in the history
Update Automated Test
  • Loading branch information
TrevorSchirmer authored Nov 5, 2024
2 parents ed6f441 + 070f3c6 commit 7c01b45
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
3 changes: 2 additions & 1 deletion Integrations/ESPHome/Core.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
substitutions:
name: apollo-plt-1
version: "24.10.25.1"
version: "24.10.31.1"
device_description: ${name} made by Apollo Automation - version ${version}.

esp32:
Expand Down Expand Up @@ -168,6 +168,7 @@ binary_sensor:
id(runTest) = true;
id(deep_sleep_run_duration).publish_state(60);
id(deep_sleep_sleep_duration).publish_state(60);
id(prevent_sleep).turn_on();
id(factory_reset_switch).turn_on();
}
else if (millis() - id(button_press_timestamp) >= 3000) {
Expand Down
37 changes: 22 additions & 15 deletions Integrations/ESPHome/PLT-1B.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,29 @@ esphome:

min_version: 2024.2.0
on_boot:
priority: 999.0
then:
- switch.turn_on: accessory_power
- priority: 999.0
then:
- switch.turn_on: accessory_power

- lambda: |-
id(deep_sleep_1).set_run_duration(id(deep_sleep_run_duration).state * 1000);
id(deep_sleep_1).set_sleep_duration(id(deep_sleep_sleep_duration).state * 60 * 60 * 1000);
- if:
condition:
or:
- binary_sensor.is_on: ota_mode
- switch.is_on: prevent_sleep
then:
- lambda: |-
ESP_LOGW("Apollo", "Preventing Deep Sleep Due To OTA On Boot");
id(deep_sleep_1).prevent_deep_sleep();
- lambda: |-
id(deep_sleep_1).set_run_duration(id(deep_sleep_run_duration).state * 1000);
id(deep_sleep_1).set_sleep_duration(id(deep_sleep_sleep_duration).state * 60 * 60 * 1000);
- if:
condition:
or:
- binary_sensor.is_on: ota_mode
- switch.is_on: prevent_sleep
then:
- lambda: |-
ESP_LOGW("Apollo", "Preventing Deep Sleep Due To OTA On Boot");
id(deep_sleep_1).prevent_deep_sleep();
- priority: -10
then:
- if:
condition:
- lambda: "return id(runTest);"
then:
- lambda: "id(testScript).execute();"

on_shutdown:
- light.turn_off: rgb_light
Expand Down

0 comments on commit 7c01b45

Please sign in to comment.