slint/examples/energy-monitor
2024-10-16 15:38:46 +02:00
..
src Energy monitor: Fix deprecated warning and improve menu on android 2024-03-11 15:50:18 +01:00
ui Use the selectable and selected accessibility properties in the energy-monitor example 2024-10-16 15:38:46 +02:00
build.rs Domain: slint-ui.com -> slint.dev 2023-06-16 10:55:08 +02:00
Cargo.toml Bump version number to 1.9.0 2024-09-25 11:49:15 +00:00
index.html Energy-monitor: android build and wasm simplicifation 2024-03-07 08:56:09 +01:00
README.md Energy-monitor: android build and wasm simplicifation 2024-03-07 08:56:09 +01:00

Energy Monitor Demo

Energy Monitor Demo Screenshot

This is a demonstration of the Slint toolkit. This demo can be executed on various platforms.

Displaying Real-Time Weather Data

To showcase real-time weather data, you will need an application key from https://www.weatherapi.com/. You can inject the API key by setting the WEATHER_API environment variable. The geographical location for the weather data can be set using the WEATHER_LAT and WEATHER_LONG variables. By default, the location is set to Berlin.

Platform Compatibility

Desktop (Windows/Mac/Linux) or Embedded Linux

You can run the demo on a desktop or embedded Linux environment with the following command:

cargo run -p energy-monitor

Microcontrolers (MCU)

Refer to the MCU backend Readme for instructions on how to run the demo on smaller devices like the Raspberry Pi Pico.

To run the MCU-like code on desktop, use the --features=simulator

cargo run -p energy-monitor --no-default-features --features=simulator --release

Android

First, set up your Android environment. Then, you can run the demo on an Android device with the following command:

cargo apk run -p energy-monitor --target aarch64-linux-android --lib

Web

cargo install wasm-pack
cd examples/energy-monitor/
wasm-pack build --release --target web --no-default-features --features slint/default,chrono
python3 -m http.server