# depuntism/weather_station_pi architecture

> Architecture diagram of the GitHub repository depuntism/weather_station_pi, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/depuntism/weather_station_pi
- Repository: https://github.com/depuntism/weather_station_pi

## Overview

Weather News Station runs a one-shot update cycle: it fetches weather and French headlines, composes a two-color dashboard, then updates or sleeps the e-paper display. Its optional pressure/temperature history graph uses persisted readings; the README also documents nighttime clearing, periodic hardware recovery, and six-minute scheduling. Weather/news API details and the rendering/driver calls are visible in excerpts; scheduling and several recovery branches are documented but not fully sampled.

Main entry points: [`Assistant_main.py`](https://github.com/depuntism/weather_station_pi/blob/main/Assistant_main.py) (Cycle coordinator), [`tools/graph.py`](https://github.com/depuntism/weather_station_pi/blob/main/tools/graph.py) (History graph), [`weather.py`](https://github.com/depuntism/weather_station_pi/blob/main/weather.py) (Forecast data), [`news.py`](https://github.com/depuntism/weather_station_pi/blob/main/news.py) (French headlines)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cycle["Update cycle"]
  node_main["Cycle coordinator<br/>[Assistant_main.py]"]
  node_scheduler["Six-minute trigger<br/>[weathernews.timer]"]
end

subgraph group_data["Weather and news"]
  node_weather["Forecast data<br/>[weather.py]"]
  node_news["French headlines<br/>[news.py]"]
  node_pollution["Air quality<br/>[weather.py]"]
end

subgraph group_render["Dashboard rendering"]
  node_display["Canvas and icons<br/>[display.py]"]
  node_graph["History graph<br/>[graph.py]"]
  node_history[("Graph history")]
end

subgraph group_hardware["E-paper hardware"]
  node_driver["Panel driver<br/>[epd7in5b_V2.py]"]
  node_gpio["GPIO and SPI<br/>[epdconfig.py]"]
end

node_user(("Station operator"))
node_openmeteo["Open-Meteo"]
node_currents["CurrentsAPI"]
node_panel["Waveshare e-paper"]

node_user -->|"starts cycle"| node_main
node_scheduler -->|"triggers cycle"| node_main
node_main -->|"requests forecasts"| node_weather
node_weather -->|"fetches forecast"| node_openmeteo
node_main -->|"requests headlines"| node_news
node_news -->|"fetches headlines"| node_currents
node_main -->|"draws dashboard"| node_display
node_main -->|"draws optional graph"| node_graph
node_graph -->|"reads history inputs"| node_weather
node_graph -->|"reads/writes"| node_history
node_main -->|"initializes and updates"| node_driver
node_driver -->|"uses hardware interface"| node_gpio
node_gpio -->|"controls panel"| node_panel
node_main -.->|"optional data use"| node_pollution

click node_main "https://github.com/depuntism/weather_station_pi/blob/main/Assistant_main.py"
click node_scheduler "https://github.com/depuntism/weather_station_pi/blob/main/weathernews.timer"
click node_weather "https://github.com/depuntism/weather_station_pi/blob/main/weather.py"
click node_news "https://github.com/depuntism/weather_station_pi/blob/main/news.py"
click node_pollution "https://github.com/depuntism/weather_station_pi/blob/main/weather.py"
click node_display "https://github.com/depuntism/weather_station_pi/blob/main/display.py"
click node_graph "https://github.com/depuntism/weather_station_pi/blob/main/tools/graph.py"
click node_driver "https://github.com/depuntism/weather_station_pi/blob/main/epd7in5b_V2.py"
click node_gpio "https://github.com/depuntism/weather_station_pi/blob/main/epdconfig.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_scheduler toneBlue
class node_weather,node_news,node_pollution toneAmber
class node_display,node_graph,node_history,node_currents toneMint
class node_driver,node_gpio toneRose
class node_user,node_openmeteo,node_panel toneIndigo
```

## Components

### Update cycle

- [Cycle coordinator](https://github.com/depuntism/weather_station_pi/blob/main/Assistant_main.py): `Assistant_main.py`
- [Six-minute trigger](https://github.com/depuntism/weather_station_pi/blob/main/weathernews.timer): `weathernews.timer`

### Weather and news

- [Forecast data](https://github.com/depuntism/weather_station_pi/blob/main/weather.py): `weather.py`
- [French headlines](https://github.com/depuntism/weather_station_pi/blob/main/news.py): `news.py`
- [Air quality](https://github.com/depuntism/weather_station_pi/blob/main/weather.py): `weather.py`

### Dashboard rendering

- [Canvas and icons](https://github.com/depuntism/weather_station_pi/blob/main/display.py): `display.py`
- [History graph](https://github.com/depuntism/weather_station_pi/blob/main/tools/graph.py): `tools/graph.py`
- **Graph history**

### E-paper hardware

- [Panel driver](https://github.com/depuntism/weather_station_pi/blob/main/epd7in5b_V2.py): `epd7in5b_V2.py`
- [GPIO and SPI](https://github.com/depuntism/weather_station_pi/blob/main/epdconfig.py): `epdconfig.py`

### Other components

- **Station operator**
- **Open-Meteo**
- **CurrentsAPI**
- **Waveshare e-paper**

## Connections

- Station operator → Cycle coordinator: starts cycle (evidence: `README.md`)
- Six-minute trigger → Cycle coordinator: triggers cycle (evidence: `README.md`)
- Cycle coordinator → Forecast data: requests forecasts (evidence: `Assistant_main.py`)
- Forecast data → Open-Meteo: fetches forecast (evidence: `weather.py`)
- Cycle coordinator → French headlines: requests headlines (evidence: `Assistant_main.py`)
- French headlines → CurrentsAPI: fetches headlines (evidence: `news.py`)
- Cycle coordinator → Canvas and icons: draws dashboard (evidence: `Assistant_main.py`)
- Cycle coordinator → History graph: draws optional graph (evidence: `Assistant_main.py`)
- History graph → Forecast data: reads history inputs (evidence: `tools/graph.py`)
- History graph → Graph history: reads/writes (evidence: `tools/graph.py`)
- Cycle coordinator → Panel driver: initializes and updates (evidence: `README.md`)
- Panel driver → GPIO and SPI: uses hardware interface (evidence: `epd7in5b_V2.py`)
- GPIO and SPI → Waveshare e-paper: controls panel (evidence: `README.md`)
- Cycle coordinator → Air quality: optional data use (evidence: `Assistant_main.py`)
