wasp-os/wasp/boards/simulator/main.py
Tait Berlette dc40430faa apps: Fixed weather app with GadgetBridge.
When I created the weather app I didn't have GadgetBridge installed, so I tried to follow the protocol on the [espurino website](https://www.espruino.com/Gadgetbridge), but it wasn't very helpful and I made some mistakes. This commit should fix these mistakes to stop the weather app from crashing, and so it displays the correct values. I have also added a new settings option called "Units", where apps can see what units the user would prefer (metric/imperial).

Signed-off-by: Tait Berlette <54515877+taitberlette@users.noreply.github.com>
2021-08-23 20:09:02 +01:00

52 lines
1.3 KiB
Python

# SPDX-License-Identifier: LGPL-3.0-or-later
# Copyright (C) 2020 Daniel Thompson
import wasp
# Test app is used a lot on the simulator. Let's make sure it is
# registered by default.
wasp.system.register('apps.testapp.TestApp')
# Ensure there's something interesting to look at ;-)
wasp.system.set_music_info({
'track': 'Tasteless Brass Duck',
'artist': 'Dreams of Bamboo',
})
wasp.system.set_weather_info({
'temp': 295,
'hum': 100,
'txt': 'Cloudy',
'wind': 25,
'loc': 'Toronto'
})
# Increase the display blanking time to avoid spamming the console
# with backlight activations.
wasp.system.blank_after = 300
# Replace the default (digital) clock with an alternative
# (digital) clock with this alternative.
#wasp.system.register('apps.chrono.ChronoApp', watch_face=True)
# Enable the demostration application
#wasp.system.register('apps.demo.DemoApp')
# Adopt a basic all-orange theme
#wasp.system.set_theme(
# b'\xff\x00' # ble
# b'\xff\x00' # scroll-indicator
# b'\xff\x00' # battery
# b'\xff\x00' # status-clock
# b'\xff\x00' # notify-icon
# b'\xff\x00' # bright
# b'\xbe\xe0' # mid
# b'\xff\x00' # ui
# b'\xff\x00' # spot1
# b'\xff\x00' # spot2
# b'\x00\x0f' # contrast
# )
wasp.system.run()