Skip to content

Commit

Permalink
Remove pulse animation while updating
Browse files Browse the repository at this point in the history
  • Loading branch information
alexwohlbruck committed May 11, 2022
1 parent 80be1dd commit db9b772
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
3 changes: 3 additions & 0 deletions docs/indicators/dot-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
| <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 |
| <img src="indicators/dot-white.svg" width='12'> | White | Factory resetting or installing firmware update |



## Signing in
Visit https://www.projectcovalent.app and sign in with your Google account. You will be redirected to the home page where you see your lamp or pair a new one.
Visit **https://www.projectcovalent.app** and sign in with your Google account. You will be redirected to the home page where you see your lamp or pair a new one.

## Pairing a lamp
The app uses Bluetooth to pair to your lamp and configure it. This is not supported on iOS devices, or in the Safari browser. Compatible browsers are Chrome, Opera, Edge, and Samsung Internet. For more info about compatibility, visit <a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Bluetooth_API#browser_compatibility" target="_blank">this page</a>.
Expand Down
1 change: 0 additions & 1 deletion micro/app/led.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,6 @@ def pulse(color=None, state=None):
def pulse_thread(state):
global effect
while (effect == EFFECT_PULSE):
print('pulsing')
# Fade out from 100% to 50%
for i in range(20):
for j in range(led_count):
Expand Down
2 changes: 1 addition & 1 deletion micro/app/ota/ota_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def install_update_if_available(self) -> bool:
if latest_version > current_version:
print('Updating to version {}...'.format(latest_version))
set_color((255, 255, 255))
pulse()
# pulse()

self._create_new_version_file(latest_version)
self._download_new_version(latest_version)
Expand Down
16 changes: 10 additions & 6 deletions micro/app/startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@
import app.mcron.decorators

def check_update_and_install():
otaUpdater = OTAUpdater('https://github.com/alexwohlbruck/covalent', github_src_dir='micro', main_dir='app')
hasUpdated = otaUpdater.install_update_if_available()
if hasUpdated:
try:
otaUpdater = OTAUpdater('https://github.com/alexwohlbruck/covalent', github_src_dir='micro', main_dir='app')
hasUpdated = otaUpdater.install_update_if_available()
if hasUpdated:
machine.reset()
else:
del(otaUpdater)
gc.collect()
except Exception as e:
# Somtimes there are network errors. Restart the device in case
machine.reset()
else:
del(otaUpdater)
gc.collect()

def counter(callback_id, current_time, callback_memory):
check_update_and_install()
Expand Down

0 comments on commit db9b772

Please sign in to comment.