Skip to content

Commit 75f4463

Browse files
Merge pull request #7 from ApolloAutomation/FirmwareSwitch
Add Firmware Switch
2 parents 661b983 + 62fcc94 commit 75f4463

File tree

3 files changed

+52
-1
lines changed

3 files changed

+52
-1
lines changed

Integrations/ESPHome/Core.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
substitutions:
2-
version: "25.5.9.1"
2+
version: "25.5.19.1"
33

44
esp32:
55
board: esp32-s3-devkitc-1

Integrations/ESPHome/R_PRO-1_ETH.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,31 @@ ethernet:
4545
interrupt_pin: GPIO13
4646
reset_pin: GPIO14
4747

48+
select:
49+
- platform: template
50+
id: firmware_selector
51+
name: Firmware Type
52+
icon: "mdi:test-tube"
53+
entity_category: config
54+
optimistic: true
55+
restore_value: true
56+
options:
57+
- "WiFi"
58+
- "Ethernet"
59+
initial_option: "Ethernet"
60+
on_value:
61+
then:
62+
- if:
63+
condition:
64+
lambda: 'return id(firmware_selector).state == "Ethernet";'
65+
then:
66+
- logger.log: "OTA updates set to use ethernet firmware"
67+
- lambda: id(update_http_request).set_source_url("https://apolloautomation.github.io/R_PRO-1/firmware-e/manifest.json");
68+
- component.update: update_http_request
69+
else:
70+
- logger.log: "OTA updates set to use wifi firmware"
71+
- lambda: id(update_http_request).set_source_url("https://apolloautomation.github.io/R_PRO-1/firmware-w/manifest.json");
72+
- component.update: update_http_request
4873

4974
packages:
5075
core: !include Core.yaml

Integrations/ESPHome/R_PRO-1_W.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,31 @@ wifi:
5656

5757
captive_portal:
5858

59+
select:
60+
- platform: template
61+
id: firmware_selector
62+
name: Firmware Type
63+
icon: "mdi:test-tube"
64+
entity_category: config
65+
optimistic: true
66+
restore_value: true
67+
options:
68+
- "WiFi"
69+
- "Ethernet"
70+
initial_option: "WiFi"
71+
on_value:
72+
then:
73+
- if:
74+
condition:
75+
lambda: 'return id(firmware_selector).state == "Ethernet";'
76+
then:
77+
- logger.log: "OTA updates set to use ethernet firmware"
78+
- lambda: id(update_http_request).set_source_url("https://apolloautomation.github.io/R_PRO-1/firmware-e/manifest.json");
79+
- component.update: update_http_request
80+
else:
81+
- logger.log: "OTA updates set to use wifi firmware"
82+
- lambda: id(update_http_request).set_source_url("https://apolloautomation.github.io/R_PRO-1/firmware-w/manifest.json");
83+
- component.update: update_http_request
84+
5985
packages:
6086
core: !include Core.yaml

0 commit comments

Comments
 (0)