Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
219ab59
changes for a 2.1.1 version of Pi Weather Rock with Internationalizat…
carloshm Apr 16, 2021
b381e7e
Delete piweatherrock.lang.json
carloshm Apr 16, 2021
95f4c9f
Delete screenshot.jpeg
carloshm Apr 17, 2021
34a552b
Delete weather-mock.json
carloshm Apr 17, 2021
8daed5d
Delete forecast-mock.json
carloshm Apr 17, 2021
ce7d494
Delete pwr-config-upgrade
carloshm Apr 17, 2021
6105dd5
Delete pwr-ui
carloshm Apr 17, 2021
7af61d5
version 2.2.1 with intl and local with sample for es, eu, gl, en, it,…
carloshm Apr 17, 2021
60db718
Merge branch 'master' of https://github.com/carloshm/PiWeatherRock
carloshm Apr 17, 2021
be01888
fix requirements python-i18n
carloshm Apr 17, 2021
16020b9
typo es lang
carloshm Apr 17, 2021
ae51ac2
remove unnecessary imports
carloshm Apr 17, 2021
b25595c
included timezone
carloshm Apr 18, 2021
bca700f
changes for openmeteo vs darksky
carloshm Apr 30, 2023
4c9553d
fix typo
carloshm Apr 30, 2023
b647074
Update forecast.py
carloshm Nov 7, 2023
f8f76f9
Update forecast.py
carloshm Nov 7, 2023
8f0a13d
Update openmeteo.py
broundonb Aug 12, 2024
41c59a6
Update openmeteo.py
broundonb Aug 12, 2024
247afca
Update piweatherrock.es.json
broundonb Aug 12, 2024
ef3a3b8
Update openmeteo.py
broundonb Aug 12, 2024
ad6ad87
Create piweatherrock-config.json
carloshm Aug 12, 2024
e506603
Update README.md
carloshm Aug 12, 2024
a91abc7
Update README.md
carloshm Aug 12, 2024
c63fc50
Update README.md
carloshm Aug 12, 2024
dd7c507
Update README.md
carloshm Aug 12, 2024
82c024c
Update README.md
carloshm Aug 12, 2024
c704e40
Update README.md
carloshm Aug 12, 2024
be4a971
Update README.md
carloshm Aug 12, 2024
ad9bd63
Update README.md
carloshm Aug 12, 2024
dec50dd
Update piweatherrock.es.json
broundonb Aug 12, 2024
2ae4f02
Update piweatherrock.es.json
broundonb Aug 12, 2024
d4bd306
Update __init__.py
carloshm Aug 12, 2024
dfb5d44
Update __init__.py
carloshm Aug 12, 2024
b06fe1a
Update __init__.py
carloshm Aug 12, 2024
bd0da1f
Add files via upload
carloshm Aug 28, 2024
e6f52c2
Add files via upload
carloshm Aug 28, 2024
13eecfb
Add files via upload
carloshm Aug 28, 2024
4f90bb9
Add files via upload
carloshm Aug 28, 2024
d790068
docs: update README and documentation to reflect Open-Meteo API migra…
Copilot May 6, 2026
50ac29a
Merge pull request #1 from carloshm/copilot/update-readme-and-documen…
carloshm May 6, 2026
6af91a3
Add consolidated project audit
Copilot May 6, 2026
3ee72ff
Clarify icon typo audit finding
Copilot May 6, 2026
44c89fa
Emphasize eval risk in audit
Copilot May 6, 2026
9d35a89
Merge pull request #2 from carloshm/copilot/consolidar-auditoria-proy…
carloshm May 6, 2026
f5c6b65
refactor: migrate from setup.py to pyproject.toml (PEP 621)
Copilot May 7, 2026
0791ea4
fix: restore requires-python to >=3.6 to match original setup.py
Copilot May 7, 2026
d10e1b1
docs: update documentation and metadata for new deployment
Copilot May 7, 2026
4cbbd12
docs: add config file setup instructions in README and install.sh
Copilot May 7, 2026
3963070
fix: address audit bugs and performance issues
Copilot May 7, 2026
1308748
fix: rename hourly helper variables to remove leading underscores
Copilot May 7, 2026
dcbec88
Merge pull request #4 from carloshm/copilot/ajustar-documentacion-dep…
carloshm May 7, 2026
269a685
Merge pull request #5 from carloshm/frame
carloshm May 7, 2026
67a0deb
Update installation docs and add app guide
Copilot May 7, 2026
5870fce
Clarify docs installation flow
Copilot May 7, 2026
566d7b1
Add configuration hot reload and web UI
Copilot May 7, 2026
62d8e0e
Respect enabled weather pages during reload
Copilot May 7, 2026
0158f84
Address config UI review feedback
Copilot May 7, 2026
17b2c02
Address remaining validation feedback
Copilot May 7, 2026
89fb376
Localize config UI field labels
Copilot May 7, 2026
cb191ca
Apply final validation refinements
Copilot May 7, 2026
7e00e8e
Clean up hot reload readability
Copilot May 7, 2026
702ccfe
Clarify UI loop hot reload helpers
Copilot May 7, 2026
31abdf2
Merge pull request #6 from carloshm/copilot/propuesta-configuracion-p…
carloshm May 7, 2026
3e72769
Complete required localization coverage
Copilot May 7, 2026
888417a
Merge pull request #7 from carloshm/copilot/check-app-localization
carloshm May 7, 2026
36b830b
Merge pull request #8 from carloshm/copilot/update-docs-with-screenshots
carloshm May 7, 2026
d6e3896
Add visual config app documentation
Copilot May 7, 2026
ba500a4
Merge pull request #9 from carloshm/copilot/documentar-aplicacion-con…
carloshm May 7, 2026
1f43b47
Add configurable local media screen
Copilot May 7, 2026
19b5738
Complete media screen localization
Copilot May 7, 2026
202bdf1
Avoid repeated video fallback retries
Copilot May 7, 2026
8b7f003
Refine media screen helpers
Copilot May 7, 2026
1866064
Address media validation feedback
Copilot May 7, 2026
2652745
Clarify media screen helper names
Copilot May 7, 2026
d22db9e
Harden media fit fallback
Copilot May 7, 2026
f8004be
Make video frame reads nonblocking
Copilot May 7, 2026
2057c31
Document media configuration constraints
Copilot May 7, 2026
16b9394
Merge master and resolve documentation conflicts
Copilot May 8, 2026
5ad81a1
Merge pull request #10 from carloshm/copilot/add-image-video-display-…
carloshm May 8, 2026
bc18627
Force LF line endings for shell scripts
Copilot May 8, 2026
dd8b34b
Merge pull request #11 from carloshm/copilot/fix-install-script-error
carloshm May 8, 2026
fed260d
Improve web config UI structure
Copilot May 8, 2026
537aaeb
Address config help icon accessibility
Copilot May 8, 2026
f8c8638
Make config UI tests language agnostic
Copilot May 8, 2026
470b50e
Refine config UI review feedback
Copilot May 8, 2026
d49045a
Tidy config UI constants
Copilot May 8, 2026
930a330
Localize config select fallback
Copilot May 8, 2026
8ebb332
Merge pull request #12 from carloshm/copilot/add-styling-and-settings…
carloshm May 8, 2026
c9b5fec
Add Open-Meteo mapping audit
Copilot May 8, 2026
66f7dbe
Merge pull request #13 from carloshm/copilot/analizar-diferencias-api…
carloshm May 8, 2026
657cf4a
Route legacy config command to improved UI
Copilot May 8, 2026
316f208
Merge pull request #14 from carloshm/copilot/improve-ui-performance
carloshm May 8, 2026
4db74e8
Delete AUDITORIA_PROYECTO.md
carloshm May 8, 2026
37463dd
unify config entry points, add light/dark theme, update docs
Copilot May 8, 2026
ae8cbdb
Merge pull request #15 from carloshm/copilot/unify-configuration-apps
carloshm May 8, 2026
d912a37
Improve config web location UI
Copilot May 8, 2026
2dc1cb0
Localize config web location controls
Copilot May 8, 2026
6b6c393
Fix config web script indentation
Copilot May 8, 2026
8129753
Address config web review feedback
Copilot May 8, 2026
11e05a1
Clarify missing web text error
Copilot May 8, 2026
519d9da
Polish config web review cleanup
Copilot May 8, 2026
c774486
Merge pull request #16 from carloshm/copilot/fix-pwr-config-web-funct…
carloshm May 8, 2026
ac9de6d
Improve cross-platform config UI
May 8, 2026
a584f0f
Update default runtime config
May 8, 2026
724a760
Update release documentation
May 8, 2026
ac5bc6b
Make install script executable
Copilot May 8, 2026
ac315de
Merge pull request #17 from carloshm/copilot/add-executable-permissio…
carloshm May 8, 2026
18b506d
Add command availability troubleshooting
Copilot May 8, 2026
5cd87f8
Merge pull request #18 from carloshm/copilot/fix-pwr-config-web-error
carloshm May 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.sh text eol=lf
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ config.py
config.json
*.swp
.log
*.bak

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
9 changes: 0 additions & 9 deletions .travis.yml

This file was deleted.

22 changes: 21 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Change log

## [3.0.0](https://github.com/carloshm/PiWeatherRock) - 2026-05-08

- Migrated weather API from Dark Sky to [Open-Meteo](https://open-meteo.com/)
- Added `openmeteo.py` module to translate Open-Meteo responses to the internal Dark Sky data format
- No API key is required for non-commercial use with Open-Meteo
- Added internationalization support with `intl` module
- Updated configuration to use Open-Meteo endpoint
- Migrated packaging from `setup.py` to `pyproject.toml` (PEP 621)
- Added `timezone` to configuration
- Updated project metadata and homepage to carloshm fork
- Added current console entry points: `pwr-ui`, `pwr-config-web`, and `pwr-config-upgrade`
- Added a guided local web configuration UI with map-based location selection, theme support, runtime validation, and Open-Meteo test
- Added hot-reload support so valid JSON configuration changes can be applied while `pwr-ui` is running
- Added local media screen support for images and short videos, including fit modes and `ffmpeg`-based video playback
- Improved cross-platform support for Windows, macOS, and Linux display initialization
- Made video frame reading compatible with Windows by replacing pipe `select()` usage with a background reader queue
- Added safer config web handling with CSRF-protected saves, fixed success messages, and security headers
- Added UTF-8 config reading/writing and `~`/environment variable expansion for local media paths
- Updated the default sample/runtime configuration for Getafe (`Europe/Madrid`) and `cover` media fit
- Updated installation and usage documentation, including Windows PowerShell instructions and the corrected MIT license link

## [2.1.0](https://github.com/genebean/PiWeatherRock/tree/2.1.0)

- Add option for 24h time
Expand Down Expand Up @@ -44,4 +65,3 @@

- First stable release that includes proper documentation.
The documentation now lives at https://piweatherrock.technicalissues.us

2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

187 changes: 180 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,192 @@
# PiWeatherRock

![GitHub](https://img.shields.io/github/license/genebean/PiWeatherRock)
![PyPI](https://img.shields.io/pypi/v/piweatherrock)
[![License: MIT](https://img.shields.io/github/license/carloshm/PiWeatherRock)](LICENSE)

PiWeatherRock displays local weather on (almost) any screen you connect to a Raspberry Pi. It also works on other platforms, including macOS.
PiWeatherRock displays local weather on (almost) any screen you connect to a Raspberry Pi. It also works on other platforms, including Windows and macOS.

More information about the project and full documentation can be found at https://piweatherrock.technicalissues.us. Be sure to check out the getting started guide under the documentation link there for instruction on how to set everything up.
## Weather API

This project uses the [Open-Meteo API](https://open-meteo.com/) to fetch weather data. Open-Meteo is a free, open-source weather API that does not require an API key for non-commercial use.

> **Note:** Previous versions of PiWeatherRock used the [Dark Sky API](https://darksky.net/), which was shut down. The project has been migrated to use Open-Meteo as a drop-in replacement. The internal data format still follows the Dark Sky structure for backward compatibility, with the `openmeteo.py` module handling the translation between APIs.

### Configuration

Weather settings are configured in `piweatherrock/piweatherrock-config.json`:

- `ds_api_key`: Identifier for the Open-Meteo request (no real API key needed). The name is a legacy reference from the Dark Sky era, kept for backward compatibility.
- `lat` / `lon`: Your location coordinates.
- `units`: Unit system (`si` for metric).
- `lang`: Language for weather descriptions (`en`, `es`, `ca`, `gl`, `eu`).
- `ui_lang`: Language for UI labels (`en`, `es`, `ca`, `gl`, `eu`).
- `timezone`: Your timezone (e.g., `Europe/Madrid`).
- `update_freq`: How often to refresh weather data (in seconds).
- `fullscreen`, `12hour_disp`, `icon_offset`: Display behavior.
- `info_pause`, `info_delay`, `plugins`: Page rotation behavior. `plugins`
controls which screens are shown (`daily`, `hourly`, `info`, `media`) and
each screen's display time.
- `plugins.media`: Local media screen settings for images and short videos
loaded from a folder. Configure `enabled`, `pause`, `path`, `shuffle`, `fit`
(`contain`, `cover`, or `stretch`), and allowed `extensions`.
The folder in `path` must already exist before enabling this screen.

PiWeatherRock automatically checks the config file while `pwr-ui` is running.
Valid changes are applied without restarting the display. If the JSON is invalid,
the active configuration remains in use and the error is logged.

You can edit the same JSON from the local web configuration UI:

```bash
pwr-config-web -c ./piweatherrock/piweatherrock-config.json
```

The config UI binds to `127.0.0.1:8888` by default. Use `--host` and `--port`
only when you intentionally want to expose it elsewhere on your network.
Add `--open` to launch the default browser automatically. If the chosen port is
already in use, the command exits with a clear error instead of a server stack
trace.
The same UI exposes the screen selection, display time, and local media folder
settings. The location map can be panned and zoomed normally; use the pin button
when you want a map click to update latitude and longitude. The interface
supports both light and dark themes with an automatic toggle based on system
preference. It also includes runtime validation, CSRF-protected saves, security
headers, and an Open-Meteo test using the configured latitude, longitude, and
timezone.
See the expanded visual guide in [`docs/README.md`](docs/README.md#aplicaci%C3%B3n-web-de-configuraci%C3%B3n).

## Installation

PiWeatherRock is packaged with `pyproject.toml` and installs the current
console commands `pwr-ui`, `pwr-config-web`, and `pwr-config-upgrade`.

### Raspberry Pi / Linux

Use the installation script from the repository root:

```bash
git clone https://github.com/carloshm/PiWeatherRock.git
cd PiWeatherRock
chmod +x install.sh
./install.sh Europe/Madrid
```

The optional argument is the system timezone. The script installs the required
system packages, creates a virtual environment at `~/pwr-env`, installs
PiWeatherRock with `pip install .`, and prints the commands needed to run the
application.

Before starting the UI, create and edit your configuration file. The sample
configuration defaults to Getafe, Spain (`Europe/Madrid`):

```bash
source ~/pwr-env/bin/activate
cp piweatherrock/config.json-sample piweatherrock/piweatherrock-config.json
# Edit piweatherrock/piweatherrock-config.json with your coordinates, timezone, language, and display options.
pwr-ui -c ./piweatherrock/piweatherrock-config.json
```

### Manual or development installation (macOS/Linux)

```bash
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install --upgrade pip setuptools wheel
python3 -m pip install .
cp piweatherrock/config.json-sample piweatherrock/piweatherrock-config.json
# Edit piweatherrock/piweatherrock-config.json before running.
pwr-ui -c ./piweatherrock/piweatherrock-config.json
```

### Manual or development installation (Windows)

Use PowerShell from the repository root:

```powershell
py -m venv .venv
.\.venv\Scripts\Activate.ps1
py -m pip install --upgrade pip setuptools wheel
py -m pip install .
Copy-Item piweatherrock\config.json-sample piweatherrock\piweatherrock-config.json
# Edit piweatherrock\piweatherrock-config.json before running.
pwr-ui -c .\piweatherrock\piweatherrock-config.json
```

The `pwr-config-web` configuration UI works the same way on Windows, macOS,
and Linux. Local image playback uses pygame on all supported platforms. Local
video playback requires `ffmpeg` to be installed and available on `PATH`. Local
media paths may use `~` or environment variables, but the expanded folder must
exist before enabling the media page.

If your shell reports `pwr-config-web: command not found`, the PiWeatherRock
package is not installed in the currently active virtual environment. From the
repository root, activate the environment and reinstall the package:

```bash
source ~/pwr-env/bin/activate
python3 -m pip install .
```

Then verify that `pwr-config-web` is on `PATH` with `command -v pwr-config-web`.

See [`docs/`](docs/) for an application walkthrough with screenshots.

## Release process

- edit `version.py` according to the types of changes made
- edit `requirements.txt` if needed
- `python3 setup.py sdist bdist_wheel`
- Update version in `pyproject.toml` according to the types of changes made
- Update `requirements.txt` if needed
- `python3 -m pip install --upgrade build twine`
- `python3 -m build`
- `tar tzf dist/piweatherrock-*.tar.gz`
- `twine check dist/*`
- [optional] `twine upload --repository-url https://test.pypi.org/legacy/ dist/*`
- `twine upload dist/*`
- Create a git tag and push it

## Local Development process

```bash
python3 -m venv env_name
source env_name/bin/activate
```

```bash
git clone https://github.com/carloshm/PiWeatherRock.git
cd PiWeatherRock
git pull # for any additional external change after a while
```

Make changes

```bash
git add .
git commit -m "changes description"
git push origin main
```

## Run changes

After making code changes in a local checkout, reinstall the package in your
active virtual environment and run the UI with your configuration file:

```bash
python3 -m pip install .
pwr-ui -c ./piweatherrock/piweatherrock-config.json
```

To configure from a browser:

```bash
pwr-config-web -c ./piweatherrock/piweatherrock-config.json
```

> **Note:** `pwr-ui`, `pwr-config-web`, and `pwr-config-upgrade` are installed as console entry points via `pyproject.toml`. See [PEP 621](https://peps.python.org/pep-0621/) and [setup.py deprecation](https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html) for background.

## Validate Service Data

You can test the Open-Meteo API directly with a request like this:

```
https://api.open-meteo.com/v1/forecast?latitude=40.299457&longitude=-3.743399&timezone=Europe/Madrid&models=best_match&forecast_days=4&current_weather=true&temperature_unit=celsius&windspeed_unit=kmh&precipitation_unit=mm&timeformat=iso8601&hourly=visibility,weathercode,temperature_2m,relativehumidity_2m,apparent_temperature,surface_pressure,cloudcover,windspeed_80m,precipitation,precipitation_probability,dewpoint_2m,windspeed_10m,windgusts_10m,winddirection_10m,cloudcover_low,direct_radiation&daily=sunrise,sunset,uv_index_max,weathercode,temperature_2m_max,temperature_2m_min,apparent_temperature_max,apparent_temperature_min,precipitation_sum,precipitation_probability_mean,precipitation_probability_min,windgusts_10m_max,precipitation_probability_max,windspeed_10m_max,winddirection_10m_dominant
```

For more details on available parameters, see the [Open-Meteo API documentation](https://open-meteo.com/en/docs).
Loading