# kwgillo/zedmd-pi architecture

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

- Interactive diagram: https://gitdiagram.com/kwgillo/zedmd-pi
- Repository: https://github.com/kwgillo/zedmd-pi

## Overview

DMD Controller is a Raspberry Pi service that shares one LED panel among scheduled content sources, ZeDMD frame input, and exclusive game sessions, with a web UI for configuration and control. The graph preserves the README’s major service branches and integrations. Source excerpts expose only parts of the runtime wiring, so several orchestration relationships are documented rather than verified in sampled implementation; those are marked dashed with no evidence path.

Main entry points: [`dmdd.py`](https://github.com/kwgillo/zedmd-pi/blob/main/dmdd.py) (Service runtime), [`webui.py`](https://github.com/kwgillo/zedmd-pi/blob/main/webui.py) (Web control UI), [`sources/giochi/__init__.py`](https://github.com/kwgillo/zedmd-pi/blob/main/sources/giochi/__init__.py) (Game session), [`sources/base.py`](https://github.com/kwgillo/zedmd-pi/blob/main/sources/base.py) (Source interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Control and runtime"]
  node_webui["Web control UI<br/>[webui.py]"]
  node_runtime["Service runtime<br/>[dmdd.py]"]
  node_arbiter["Display arbitration<br/>[dmdd.py]"]
  node_source_api["Source interface<br/>[base.py]"]
end

subgraph group_content["Panel content"]
  node_clock["Clock and world time<br/>[clock.py]"]
  node_airradar["Air Radar<br/>[airradar.py]"]
  node_weather["Weather and alerts<br/>[meteo.py]"]
  node_satellites["Satellite passes<br/>[satelliti.py]"]
  node_calendar["Calendar and birthdays<br/>[calendario.py]"]
  node_deadlines["Deadlines and waste<br/>[clock.py]"]
  node_media["Media player<br/>[media.py]"]
  node_music["Now Playing<br/>[nowplaying.py]"]
  node_banner["Rolling banner<br/>[banner.py]"]
  node_notifications["Notifications<br/>[notifiche.py]"]
  node_zedmd["ZeDMD receiver<br/>[zedmd.py]"]
end

subgraph group_games["Games"]
  node_gamesession["Game session<br/>[__init__.py]"]
  node_gamebase["Game framework<br/>[base.py]"]
  node_doom["Doom<br/>[doom.py]"]
  node_gameboy["Game Boy<br/>[gameboy.py]"]
  node_builtgames["Panel games<br/>[bongo.py]"]
end

subgraph group_integrations["Integrations and state"]
  node_audio["Audio mixer<br/>[suoni.py]"]
  node_config[("Persistent configuration<br/>[dmdconf.py]")]
  node_hass["Home Assistant MQTT<br/>[hass.py]"]
  node_google["Google Calendar<br/>[gcalendar.py]"]
  node_spotify["Spotify API<br/>[spotifyapi.py]"]
end

node_user(("User"))
node_adsb["Community ADS-B APIs"]
node_openmeteo["Open-Meteo and MeteoAlarm"]
node_panel["LED panel"]

node_user -->|"controls"| node_webui
node_webui -->|"saves settings"| node_config
node_webui -->|"starts sessions"| node_runtime
node_runtime -.->|"manages display"| node_arbiter
node_arbiter -.->|"selects sources"| node_source_api
node_source_api -->|"implements"| node_clock
node_source_api -->|"implements"| node_airradar
node_source_api -->|"implements"| node_weather
node_source_api -->|"implements"| node_satellites
node_arbiter -.->|"presents frames"| node_panel
node_webui -->|"configures service"| node_zedmd
node_adsb -->|"provides flight data"| node_airradar
node_openmeteo -->|"provides forecasts"| node_weather
node_webui -->|"configures calendar"| node_calendar
node_google -->|"provides appointments"| node_calendar
node_clock -->|"reads status"| node_deadlines
node_hass -->|"sends messages"| node_notifications
node_hass -->|"updates entries"| node_deadlines
node_spotify -->|"provides track data"| node_music
node_webui -->|"starts games"| node_gamesession
node_gamesession -->|"runs games"| node_gamebase
node_gamesession -.->|"dispatches game"| node_doom
node_gamesession -.->|"dispatches game"| node_gameboy
node_gamesession -->|"dispatches game"| node_builtgames
node_gamesession -->|"plays effects"| node_audio
node_runtime -.->|"runs service"| node_media
node_runtime -.->|"runs service"| node_music
node_runtime -.->|"runs service"| node_banner
node_runtime -.->|"runs service"| node_notifications
node_runtime -.->|"runs service"| node_satellites
node_runtime -.->|"manages audio"| node_audio

click node_webui "https://github.com/kwgillo/zedmd-pi/blob/main/webui.py"
click node_runtime "https://github.com/kwgillo/zedmd-pi/blob/main/dmdd.py"
click node_arbiter "https://github.com/kwgillo/zedmd-pi/blob/main/dmdd.py"
click node_source_api "https://github.com/kwgillo/zedmd-pi/blob/main/sources/base.py"
click node_clock "https://github.com/kwgillo/zedmd-pi/blob/main/sources/clock.py"
click node_airradar "https://github.com/kwgillo/zedmd-pi/blob/main/sources/airradar.py"
click node_weather "https://github.com/kwgillo/zedmd-pi/blob/main/sources/meteo.py"
click node_satellites "https://github.com/kwgillo/zedmd-pi/blob/main/sources/satelliti.py"
click node_calendar "https://github.com/kwgillo/zedmd-pi/blob/main/sources/calendario.py"
click node_deadlines "https://github.com/kwgillo/zedmd-pi/blob/main/sources/clock.py"
click node_media "https://github.com/kwgillo/zedmd-pi/blob/main/sources/media.py"
click node_music "https://github.com/kwgillo/zedmd-pi/blob/main/sources/nowplaying.py"
click node_banner "https://github.com/kwgillo/zedmd-pi/blob/main/sources/banner.py"
click node_notifications "https://github.com/kwgillo/zedmd-pi/blob/main/sources/notifiche.py"
click node_zedmd "https://github.com/kwgillo/zedmd-pi/blob/main/sources/zedmd.py"
click node_gamesession "https://github.com/kwgillo/zedmd-pi/blob/main/sources/giochi/__init__.py"
click node_gamebase "https://github.com/kwgillo/zedmd-pi/blob/main/sources/giochi/base.py"
click node_doom "https://github.com/kwgillo/zedmd-pi/blob/main/sources/doom.py"
click node_gameboy "https://github.com/kwgillo/zedmd-pi/blob/main/sources/gameboy.py"
click node_builtgames "https://github.com/kwgillo/zedmd-pi/blob/main/sources/giochi/bongo.py"
click node_audio "https://github.com/kwgillo/zedmd-pi/blob/main/suoni.py"
click node_config "https://github.com/kwgillo/zedmd-pi/blob/main/dmdconf.py"
click node_hass "https://github.com/kwgillo/zedmd-pi/blob/main/hass.py"
click node_google "https://github.com/kwgillo/zedmd-pi/blob/main/gcalendar.py"
click node_spotify "https://github.com/kwgillo/zedmd-pi/blob/main/spotifyapi.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_webui,node_runtime,node_arbiter,node_source_api,node_user toneBlue
class node_clock,node_airradar,node_weather,node_satellites,node_calendar,node_deadlines,node_media,node_music,node_banner,node_notifications,node_zedmd toneAmber
class node_gamesession,node_gamebase,node_doom,node_gameboy,node_builtgames,node_adsb toneMint
class node_audio,node_config,node_hass,node_google,node_spotify toneRose
class node_openmeteo,node_panel toneIndigo
```

## Components

### Control and runtime

- [Web control UI](https://github.com/kwgillo/zedmd-pi/blob/main/webui.py): `webui.py`
- [Service runtime](https://github.com/kwgillo/zedmd-pi/blob/main/dmdd.py): `dmdd.py`
- [Display arbitration](https://github.com/kwgillo/zedmd-pi/blob/main/dmdd.py): `dmdd.py`
- [Source interface](https://github.com/kwgillo/zedmd-pi/blob/main/sources/base.py): `sources/base.py`

### Panel content

- [Clock and world time](https://github.com/kwgillo/zedmd-pi/blob/main/sources/clock.py): `sources/clock.py`
- [Air Radar](https://github.com/kwgillo/zedmd-pi/blob/main/sources/airradar.py): `sources/airradar.py`
- [Weather and alerts](https://github.com/kwgillo/zedmd-pi/blob/main/sources/meteo.py): `sources/meteo.py`
- [Satellite passes](https://github.com/kwgillo/zedmd-pi/blob/main/sources/satelliti.py): `sources/satelliti.py`
- [Calendar and birthdays](https://github.com/kwgillo/zedmd-pi/blob/main/sources/calendario.py): `sources/calendario.py`
- [Deadlines and waste](https://github.com/kwgillo/zedmd-pi/blob/main/sources/clock.py): `sources/clock.py`
- [Media player](https://github.com/kwgillo/zedmd-pi/blob/main/sources/media.py): `sources/media.py`
- [Now Playing](https://github.com/kwgillo/zedmd-pi/blob/main/sources/nowplaying.py): `sources/nowplaying.py`
- [Rolling banner](https://github.com/kwgillo/zedmd-pi/blob/main/sources/banner.py): `sources/banner.py`
- [Notifications](https://github.com/kwgillo/zedmd-pi/blob/main/sources/notifiche.py): `sources/notifiche.py`
- [ZeDMD receiver](https://github.com/kwgillo/zedmd-pi/blob/main/sources/zedmd.py): `sources/zedmd.py`

### Games

- [Game session](https://github.com/kwgillo/zedmd-pi/blob/main/sources/giochi/__init__.py): `sources/giochi/__init__.py`
- [Game framework](https://github.com/kwgillo/zedmd-pi/blob/main/sources/giochi/base.py): `sources/giochi/base.py`
- [Doom](https://github.com/kwgillo/zedmd-pi/blob/main/sources/doom.py): `sources/doom.py`
- [Game Boy](https://github.com/kwgillo/zedmd-pi/blob/main/sources/gameboy.py): `sources/gameboy.py`
- [Panel games](https://github.com/kwgillo/zedmd-pi/blob/main/sources/giochi/bongo.py): `sources/giochi/bongo.py`

### Integrations and state

- [Audio mixer](https://github.com/kwgillo/zedmd-pi/blob/main/suoni.py): `suoni.py`
- [Persistent configuration](https://github.com/kwgillo/zedmd-pi/blob/main/dmdconf.py): `dmdconf.py`
- [Home Assistant MQTT](https://github.com/kwgillo/zedmd-pi/blob/main/hass.py): `hass.py`
- [Google Calendar](https://github.com/kwgillo/zedmd-pi/blob/main/gcalendar.py): `gcalendar.py`
- [Spotify API](https://github.com/kwgillo/zedmd-pi/blob/main/spotifyapi.py): `spotifyapi.py`

### Other components

- **User**
- **Community ADS-B APIs**
- **Open-Meteo and MeteoAlarm**
- **LED panel**

## Connections

- User → Web control UI: controls
- Web control UI → Persistent configuration: saves settings (evidence: `webui.py`)
- Web control UI → Service runtime: starts sessions (evidence: `webui.py`)
- Service runtime → Display arbitration: manages display
- Display arbitration → Source interface: selects sources
- Source interface → Clock and world time: implements (evidence: `sources/clock.py`)
- Source interface → Air Radar: implements (evidence: `sources/airradar.py`)
- Source interface → Weather and alerts: implements (evidence: `sources/meteo.py`)
- Source interface → Satellite passes: implements (evidence: `sources/satelliti.py`)
- Display arbitration → LED panel: presents frames
- Web control UI → ZeDMD receiver: configures service (evidence: `webui.py`)
- Community ADS-B APIs → Air Radar: provides flight data (evidence: `sources/airradar.py`)
- Open-Meteo and MeteoAlarm → Weather and alerts: provides forecasts
- Web control UI → Calendar and birthdays: configures calendar (evidence: `webui.py`)
- Google Calendar → Calendar and birthdays: provides appointments
- Clock and world time → Deadlines and waste: reads status (evidence: `sources/clock.py`)
- Home Assistant MQTT → Notifications: sends messages
- Home Assistant MQTT → Deadlines and waste: updates entries
- Spotify API → Now Playing: provides track data
- Web control UI → Game session: starts games (evidence: `webui.py`)
- Game session → Game framework: runs games (evidence: `sources/giochi/__init__.py`)
- Game session → Doom: dispatches game
- Game session → Game Boy: dispatches game
- Game session → Panel games: dispatches game (evidence: `sources/giochi/__init__.py`)
- Game session → Audio mixer: plays effects (evidence: `sources/giochi/__init__.py`)
- Service runtime → Media player: runs service
- Service runtime → Now Playing: runs service
- Service runtime → Rolling banner: runs service
- Service runtime → Notifications: runs service
- Service runtime → Satellite passes: runs service
- Service runtime → Audio mixer: manages audio
