From 50c6209bf61ed29b2a7048a4431bac6816ed8abc Mon Sep 17 00:00:00 2001 From: Maurice Makaay Date: Sun, 20 Jun 2021 01:01:39 +0200 Subject: [PATCH 1/4] Added OTA progress to the example.yaml. --- example.yaml | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/example.yaml b/example.yaml index 940a59f..e4747d8 100644 --- a/example.yaml +++ b/example.yaml @@ -58,6 +58,47 @@ api: ota: password: "Password-For-Flashing-This-Device-Over-The-Air" + # These OTA triggers are used to provide some visual feedback during the OTA + # flashing process. The light is turned blue when the upgrade starts, the + # brightness indicator will represent the update progress (fills up from 0% + # to 100%), the light will flash red when the upgrade fails or green when the + # upgrade succeeds. + # You can safely remove these if you don't want the visual feedback. + on_begin: + then: + - light.disco_on: + id: ${id_light} + red: 0% + green: 0% + blue: 100% + brightness: 2% + transition_length: 0s + on_progress: + then: + - output.set_level: + id: ${id_front_panel_illumination} + level: !lambda return (x / 100.0f); + on_end: + then: + - light.disco_on: + id: ${id_light} + red: 0% + green: 100% + blue: 0% + brightness: 2% + transition_length: 0s + on_error: + then: + - light.disco_on: + id: ${id_light} + red: 100% + green: 0% + blue: 0% + brightness: 2% + - delay: 1s + - light.disco_off: + id: ${id_light} + # The log level can be raised when needed for debugging the firmware. For # production, a low log level is recommended. Mainly because high volume log # output might interfere with the API/WiFi connection stability. So when From 5aac811d6e6906e451f609ea204a9c5a64148e7c Mon Sep 17 00:00:00 2001 From: Maurice Makaay Date: Sun, 20 Jun 2021 01:01:39 +0200 Subject: [PATCH 2/4] Added OTA progress to the example.yaml. --- example.yaml | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/example.yaml b/example.yaml index 940a59f..e4747d8 100644 --- a/example.yaml +++ b/example.yaml @@ -58,6 +58,47 @@ api: ota: password: "Password-For-Flashing-This-Device-Over-The-Air" + # These OTA triggers are used to provide some visual feedback during the OTA + # flashing process. The light is turned blue when the upgrade starts, the + # brightness indicator will represent the update progress (fills up from 0% + # to 100%), the light will flash red when the upgrade fails or green when the + # upgrade succeeds. + # You can safely remove these if you don't want the visual feedback. + on_begin: + then: + - light.disco_on: + id: ${id_light} + red: 0% + green: 0% + blue: 100% + brightness: 2% + transition_length: 0s + on_progress: + then: + - output.set_level: + id: ${id_front_panel_illumination} + level: !lambda return (x / 100.0f); + on_end: + then: + - light.disco_on: + id: ${id_light} + red: 0% + green: 100% + blue: 0% + brightness: 2% + transition_length: 0s + on_error: + then: + - light.disco_on: + id: ${id_light} + red: 100% + green: 0% + blue: 0% + brightness: 2% + - delay: 1s + - light.disco_off: + id: ${id_light} + # The log level can be raised when needed for debugging the firmware. For # production, a low log level is recommended. Mainly because high volume log # output might interfere with the API/WiFi connection stability. So when From b0208be2a903b515e0dd1be54d548e657a4edd59 Mon Sep 17 00:00:00 2001 From: Maurice Makaay Date: Sun, 20 Jun 2021 01:10:33 +0200 Subject: [PATCH 3/4] Updated the changelog for the ota progress support in the example.yaml. --- CHANGELOG.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a28d2d..11a2ff1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [1.1.0] +## [Not yet released] + +### Added +- Implemented support for visual feedback during the OTA flashing process in the + `example.yaml` file: the light becomes blue during the process, the brightness bar + represents the update progress, when updating fails the light flashes red and when it + completes successfuly, the light flashes green. + +## [1.1.0-RC1] **Note**: This release requires ESPHome v1.19.0 or newer. From 545896295d7326ac656efcaf4add984a90738dd5 Mon Sep 17 00:00:00 2001 From: Maurice Makaay Date: Sun, 20 Jun 2021 10:14:51 +0200 Subject: [PATCH 4/4] Improved the wording in the example.yaml for the new OTA triggering. --- CHANGELOG.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 11a2ff1..6663e30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,11 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Not yet released] +**Note**: This release requires ESPHome v1.20.0 or newer. + ### Added -- Implemented support for visual feedback during the OTA flashing process in the - `example.yaml` file: the light becomes blue during the process, the brightness bar - represents the update progress, when updating fails the light flashes red and when it - completes successfuly, the light flashes green. +- Implemented support for visual feedback during the OTA update process in the + `example.yaml` file: the light becomes blue during flahsing, the brightness bar + represents the progress, on failure the light flashes red and on success the + light flashes green. ## [1.1.0-RC1]