1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-02 03:12:20 +01:00

[ota] http_request update platform (#5586)

Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Edward Firmo <94725493+edwardtfn@users.noreply.github.com>
This commit is contained in:
Olivier ARCHER
2024-06-06 04:35:28 +02:00
committed by GitHub
parent 7143e9cd9e
commit 8ef4aaa70e
21 changed files with 1083 additions and 10 deletions

View File

@@ -28,10 +28,6 @@ esphome:
body: "Some data"
verify_ssl: false
wifi:
ssid: MySSID
password: password1
http_request:
useragent: esphome/tagreader
timeout: 10s

View File

@@ -0,0 +1,36 @@
wifi:
ssid: MySSID
password: password1
ota:
- platform: http_request
verify_ssl: ${verify_ssl}
on_begin:
then:
- logger.log: "OTA start"
on_progress:
then:
- logger.log:
format: "OTA progress %0.1f%%"
args: ["x"]
on_end:
then:
- logger.log: "OTA end"
on_error:
then:
- logger.log:
format: "OTA update error %d"
args: ["x"]
on_state_change:
then:
lambda: 'ESP_LOGD("ota", "State %d", state);'
button:
- platform: template
name: Firmware update
on_press:
then:
- ota_http_request.flash:
md5_url: http://my.ha.net:8123/local/esphome/firmware.md5
url: http://my.ha.net:8123/local/esphome/firmware.bin
- logger.log: "This message should be not displayed (reboot)"

View File

@@ -0,0 +1,38 @@
<<: !include common_http_request.yaml
wifi:
ssid: MySSID
password: password1
ota:
- platform: http_request
esp8266_disable_ssl_support: true
on_begin:
then:
- logger.log: "OTA start"
on_progress:
then:
- logger.log:
format: "OTA progress %0.1f%%"
args: ["x"]
on_end:
then:
- logger.log: "OTA end"
on_error:
then:
- logger.log:
format: "OTA update error %d"
args: ["x"]
on_state_change:
then:
lambda: 'ESP_LOGD("ota", "State %d", state);'
button:
- platform: template
name: Firmware update
on_press:
then:
- ota_http_request.flash:
md5_url: http://my.ha.net:8123/local/esphome/firmware.md5
url: http://my.ha.net:8123/local/esphome/firmware.bin
- logger.log: "This message should be not displayed (reboot)"

View File

@@ -0,0 +1,4 @@
substitutions:
verify_ssl: "true"
<<: !include common_ota.yaml

View File

@@ -1,2 +1,5 @@
packages:
common: !include common.yaml
substitutions:
verify_ssl: "false"
<<: !include common_http_request.yaml
<<: !include common_ota.yaml

View File

@@ -0,0 +1,4 @@
substitutions:
verify_ssl: "true"
<<: !include common_ota.yaml

View File

@@ -1,2 +1,5 @@
packages:
common: !include common.yaml
substitutions:
verify_ssl: "false"
<<: !include common_http_request.yaml
<<: !include common_ota.yaml

View File

@@ -1,2 +1,5 @@
packages:
common: !include common.yaml
substitutions:
verify_ssl: "false"
<<: !include common_http_request.yaml
<<: !include common_ota.yaml

View File

@@ -0,0 +1,4 @@
substitutions:
verify_ssl: "false"
<<: !include common_ota.yaml