Skip to content

Commit

Permalink
Add puling effect for firmware update
Browse files Browse the repository at this point in the history
  • Loading branch information
alexwohlbruck committed May 11, 2022
1 parent bb695fa commit de65d34
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
20 changes: 10 additions & 10 deletions docs/user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
- [Signing out](#signing-out)

## LED indicator colors
| | Color | Lamp mode |
|--------------------------------------------------------|------------------------|---------------------------------------|
| <img src="indicators/dot-blue-pulse.svg" width='12'> | Blue pulsing | Bluetooth pairing mode |
| <img src="indicators/dot-blue.svg" width='12'> | Blue solid | Bluetooth connected |
| <img src="indicators/dot-amber-pulse.svg" width='12'> | Amber pulsing | Connecting to wifi |
| <img src="indicators/dot-amber.svg" width='12'> | Amber solid | Connected to wifi |
| <img src="indicators/dot-green-pulse.svg" width='12'> | Green pulsing | Connecting to server |
| <img src="indicators/dot-green.svg" width='12'> | Green solid | Successfully set up |
| <img src="indicators/dot-red.svg" width='12'> | Red solid | Error |
| <img src="indicators/dot-white-pulse.svg" width='12'> | White pulsing | Factory resetting or firmware update |
| | Color | Lamp mode |
|--------------------------------------------------------|------------------------|--------------------------------------------------|
| <img src="indicators/dot-blue-pulse.svg" width='12'> | Blue pulsing | Bluetooth pairing mode |
| <img src="indicators/dot-blue.svg" width='12'> | Blue solid | Bluetooth connected |
| <img src="indicators/dot-amber-pulse.svg" width='12'> | Amber pulsing | Connecting to wifi |
| <img src="indicators/dot-amber.svg" width='12'> | Amber solid | Connected to wifi |
| <img src="indicators/dot-green-pulse.svg" width='12'> | Green pulsing | Connecting to server |
| <img src="indicators/dot-green.svg" width='12'> | Green solid | Successfully set up |
| <img src="indicators/dot-red.svg" width='12'> | Red solid | Error |
| <img src="indicators/dot-white-pulse.svg" width='12'> | White pulsing | Factory resetting or installing firmware update |



Expand Down
5 changes: 5 additions & 0 deletions micro/app/ota/ota_updater.py
Original file line number Diff line number Diff line change
@@ -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:
"""
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit de65d34

Please sign in to comment.