Metadata-Version: 2.5
Name: statsbadge-clock
Version: 1.3.0
Summary: A Swiss railway clock and weather page for statsbadge
Project-URL: Homepage, https://github.com/pimoroni/statsbadge/tree/main/extensions/statsbadge-clock
Project-URL: Repository, https://github.com/pimoroni/statsbadge
Project-URL: Issues, https://github.com/pimoroni/statsbadge/issues
Author-email: Philip Howard <phil@pimoroni.com>
License-Expression: MIT
Requires-Python: >=3.11
Requires-Dist: statsbadge
Description-Content-Type: text/markdown

# statsbadge-clock

A clock and the weather, for [statsbadge](https://github.com/pimoroni/statsbadge).

Six faces. A Swiss railway station clock with a smoothly sweeping second hand, Koppel's dotted minute track, the Amsterdam platform clock with a stop-to-go second hand, and a squircle which always uses the badge's theme. Then two digital faces, one set in the app's typeface and one in seven-segment digits over their unlit segments.

![Railway](https://raw.githubusercontent.com/pimoroni/statsbadge/main/shots/swiss_clock.png) ![Dots](https://raw.githubusercontent.com/pimoroni/statsbadge/main/shots/face_dots.png) ![Squircle](https://raw.githubusercontent.com/pimoroni/statsbadge/main/shots/face_squircle.png) ![Digital](https://raw.githubusercontent.com/pimoroni/statsbadge/main/shots/face_digital.png) ![Digital LCD](https://raw.githubusercontent.com/pimoroni/statsbadge/main/shots/face_lcd.png)

Weather comes from [Open-Meteo](https://open-meteo.com): the condition with a symbol for the sky, temperature, what it feels like, humidity and the wind. No key and no account.

## Install

```bash
statsbadge ext add clock
statsbadge install
```

Then add a **Clock** page in the config UI.

## Settings

Set a **Place** under Extensions - a town or city, and a country after a comma if the name is a common one:

```
Sheffield          the one most people mean, by how well known it is
Sheffield, US      Alabama
Paris, US          Texas
```

Which one you got comes back as `weather.place`, so the Live panel shows it. Latitude and longitude reach a spot no name lands on, and win wherever both are set. Temperature reads in celsius or fahrenheit, wind in km/h, mph, m/s or knots.

Every clock page then has settings of its own, so two pages can show two cities. A place settles the time as well as the weather, since Open-Meteo returns a location's UTC offset with its forecast: point a page at Tokyo and it shows Tokyo's time, with no timezone to set anywhere. Each page picks a face:

| Face | What it is |
| ---- | ---------- |
| `railway` | Hilfiker's station clock in the Mondaine colourway, keeping its own livery |
| `dots` | Koppel's dotted minute track, needle hands with a spike opposite each |
| `amsterdam` | Navy oval marks over a minute track of dots, and a second hand that steps a revolution out in 57 seconds then waits at twelve for the minute |
| `squircle` | The badge's furniture, in the page theme |
| `digital` | No dial: date, place, the time the height of the band, weather under it |
| `lcd` | The same layout in seven-segment digits, over their unlit segments |

**Quick add** offers Digital Clock and Station Clock, which add a page with the face already picked. The other four faces are a dropdown away once a page is there.

**Theme colours** draws a stylised face in the page theme instead of its livery: the railway clock in Mondaine red, the Amsterdam navy and the Koppel black all give way to the theme's panel, ink, dim and accent. Squircle and the two digital faces are themed either way, so the setting doesn't affect them.

Without a location the clock still keeps time, and the weather readouts read "no location set".

The same settings work from the command line, for a host with no browser near it. Anything stored by the UI wins over the flag.

```bash
statsbadge serve --extension clock.place=Sheffield
statsbadge serve --extension clock.latitude=53.38 --extension clock.longitude=-1.47
```

## Notes

The hands run off the badge's clock, set once from the host, so they keep time when the host goes away and the second hand sweeps whether or not a reading has landed. A place name is looked up once ever, not once a launch.

The seven segments are [DSEG](https://github.com/keshikan/DSEG) by keshikan, under the SIL Open Font License, whose text travels with the package.
