From de65d34cb5802f47b1d4e5fcb4931553be8c3a1a Mon Sep 17 00:00:00 2001 From: Alex Wohlbruck Date: Wed, 11 May 2022 01:54:52 -0400 Subject: [PATCH] Add puling effect for firmware update --- docs/user-guide.md | 20 ++++++++++---------- micro/app/ota/ota_updater.py | 5 +++++ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/docs/user-guide.md b/docs/user-guide.md index dd972cf..908c06d 100644 --- a/docs/user-guide.md +++ b/docs/user-guide.md @@ -16,16 +16,16 @@ - [Signing out](#signing-out) ## LED indicator colors -| | Color | Lamp mode | -|--------------------------------------------------------|------------------------|---------------------------------------| -| | Blue pulsing | Bluetooth pairing mode | -| | Blue solid | Bluetooth connected | -| | Amber pulsing | Connecting to wifi | -| | Amber solid | Connected to wifi | -| | Green pulsing | Connecting to server | -| | Green solid | Successfully set up | -| | Red solid | Error | -| | White pulsing | Factory resetting or firmware update | +| | Color | Lamp mode | +|--------------------------------------------------------|------------------------|--------------------------------------------------| +| | Blue pulsing | Bluetooth pairing mode | +| | Blue solid | Bluetooth connected | +| | Amber pulsing | Connecting to wifi | +| | Amber solid | Connected to wifi | +| | Green pulsing | Connecting to server | +| | Green solid | Successfully set up | +| | Red solid | Error | +| | White pulsing | Factory resetting or installing firmware update | diff --git a/micro/app/ota/ota_updater.py b/micro/app/ota/ota_updater.py index af12e7b..7986551 100644 --- a/micro/app/ota/ota_updater.py +++ b/micro/app/ota/ota_updater.py @@ -1,5 +1,6 @@ import os, gc from .httpclient import HttpClient +from app.led import pulse, hue, set_gradient, get_color_gradient, rgb_to_hue class OTAUpdater: """ @@ -77,6 +78,10 @@ def install_update_if_available(self) -> bool: (current_version, latest_version) = self._check_for_new_version() if latest_version > current_version: print('Updating to version {}...'.format(latest_version)) + hue = rgb_to_hue(255, 255, 255) + set_gradient(get_color_gradient(223)) + pulse() + self._create_new_version_file(latest_version) self._download_new_version(latest_version) self._copy_secrets_file()