-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from ApolloAutomation/CreateMinimalFirmware
Create Minimal Firmware On ESPHome Addon Import
- Loading branch information
Showing
4 changed files
with
204 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,9 +9,14 @@ jobs: | |
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
file: # TODO: Rename | ||
file: | ||
- Integrations/ESPHome/H-1.yaml | ||
- Integrations/ESPHome/H-1D.yaml | ||
- Integrations/ESPHome/H-1_Minimal.yaml | ||
esphome-version: | ||
- stable | ||
- beta | ||
- dev | ||
steps: | ||
- name: Checkout source code | ||
uses: actions/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,177 @@ | ||
esphome: | ||
name: "apollo-h-1" | ||
friendly_name: Apollo H-1 Minimal | ||
comment: Apollo H-1 Minimal | ||
name_add_mac_suffix: true | ||
platformio_options: | ||
board_build.flash_mode: dio | ||
|
||
project: | ||
name: "ApolloAutomation.H-1_Minimal" | ||
version: "${version}" | ||
|
||
min_version: 2023.11.1 | ||
on_boot: | ||
- priority: 500 | ||
then: | ||
- lambda: |- | ||
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 | ||
|
||
dashboard_import: | ||
package_import_url: github://ApolloAutomation/H-1/Integrations/ESPHome/H-1_Minimal.yaml | ||
import_full_config: false | ||
|
||
improv_serial: | ||
|
||
ota: | ||
- platform: esphome | ||
id: ota_esphome | ||
|
||
wifi: | ||
ap: | ||
ssid: "Apollo H1 Hotspot" | ||
|
||
logger: | ||
|
||
captive_portal: | ||
|
||
web_server: | ||
port: 80 | ||
|
||
api: | ||
services: | ||
- service: play_buzzer | ||
variables: | ||
song_str: string | ||
then: | ||
- rtttl.play: | ||
rtttl: !lambda 'return song_str;' | ||
- service: play_song_1 | ||
then: | ||
- script.execute: play_song_1 | ||
- service: play_song_2 | ||
then: | ||
- script.execute: play_song_2 | ||
- service: play_song_3 | ||
then: | ||
- script.execute: play_song_3 | ||
reboot_timeout: 0s | ||
on_client_connected: | ||
then: | ||
- delay: 5s | ||
- 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 Or Switch"); | ||
id(deep_sleep_1).prevent_deep_sleep(); | ||
switch: | ||
- platform: template | ||
name: "Prevent Sleep" | ||
id: prevent_sleep | ||
icon: mdi:sleep | ||
restore_mode: RESTORE_DEFAULT_ON | ||
optimistic: true | ||
entity_category: "config" | ||
on_turn_on: | ||
then: | ||
- lambda: |- | ||
id(deep_sleep_1).prevent_deep_sleep(); | ||
on_turn_off: | ||
then: | ||
- if: | ||
condition: | ||
binary_sensor.is_off: ota_mode | ||
then: | ||
- lambda: |- | ||
id(deep_sleep_1).allow_deep_sleep(); | ||
binary_sensor: | ||
- platform: status | ||
name: Online | ||
id: ink_ha_connected | ||
- platform: homeassistant | ||
name: "OTA Mode" | ||
id: ota_mode | ||
entity_id: input_boolean.apollo_ota_mode | ||
on_press: | ||
then: | ||
- lambda: |- | ||
id(deep_sleep_1).prevent_deep_sleep(); | ||
on_release: | ||
then: | ||
- if: | ||
condition: | ||
switch.is_off: prevent_sleep | ||
then: | ||
- lambda: |- | ||
id(deep_sleep_1).allow_deep_sleep(); | ||
sensor: | ||
- platform: wifi_signal | ||
name: RSSI | ||
id: wifi_signal_db | ||
update_interval: 60s | ||
entity_category: "diagnostic" | ||
|
||
script: | ||
- id: statusCheck | ||
then: | ||
- if: | ||
condition: | ||
- lambda: 'return id(ink_ha_connected).state;' | ||
then: | ||
- logger.log: "Apollo Automation: Connected To HA" | ||
- light.turn_on: | ||
id: rgb_light | ||
brightness: 40% | ||
red: 0% | ||
green: 0% | ||
blue: 100% | ||
else: | ||
- if: | ||
condition: | ||
- wifi.connected | ||
then: | ||
- logger.log: "Apollo Automation: Connected To Wifi" | ||
- light.turn_on: | ||
id: rgb_light | ||
brightness: 40% | ||
red: 0% | ||
green: 100% | ||
blue: 0% | ||
else: | ||
- logger.log: "Apollo Automation: Not Connected To Wifi" | ||
- light.turn_on: | ||
id: rgb_light | ||
brightness: 40% | ||
red: 100% | ||
green: 100% | ||
blue: 0% | ||
- delay: 5s | ||
- light.turn_off: rgb_light | ||
|
||
|
||
packages: | ||
core: !include Core.yaml |