How ruilima/homedeck works
HomeDeck turns YAML-defined pages and buttons into a live Stream Deck-style Home Assistant controller. Its main loop connects to a physical deck and Home Assistant, renders the current page, and dispatches button interactions; configuration also supports presets, templates, state-based appearance, navigation, sleep behavior, and layered icons. A separate FastAPI server exposes service and configuration-management endpoints. The graph includes all indexed core modules; some internal wiring is omitted where the excerpts establish imports but not calls.
Main entry points: homedeck.py Deck controller · dataclasses.py Config models · elements.py Page and button elements · configuration.py Configuration loader
Components 17
Deck runtime
- Management API
server.py - Deck entrypoint
deck.py - Deck controller
src/homedeck/homedeck.py - Event bus
src/homedeck/event_bus.py
Configuration and pages
- Configuration loader
src/homedeck/configuration.py - Configuration schema
src/homedeck/yaml/configuration.schema.yml - Config models
src/homedeck/dataclasses.py - Runtime enums
src/homedeck/enums.py - Page and button elements
src/homedeck/elements.py
Rendering
- Template renderer
src/homedeck/template.py - Icon renderer
src/homedeck/icons.py - Style utilities
src/homedeck/utils.py
External integrations
- Physical deck
- Home Assistant
- HA WebSocket client
src/homedeck/home_assistant.py
Other components
- Deck operator
- Service administrator
Connections 21
- Deck operator → Physical deck: presses buttons
README.md - Service administrator → Management API: manages service
server.py - Management API → Deck entrypoint: starts process
server.py - Deck entrypoint → Deck controller: creates controller
deck.py - Deck controller → Configuration loader: loads configuration
src/homedeck/homedeck.py - Configuration loader → Configuration schema: validates against
src/homedeck/configuration.py - Configuration loader → Config models: builds models
src/homedeck/configuration.py - Configuration loader → Page and button elements: creates pages
src/homedeck/configuration.py - Config models → Runtime enums: uses values
src/homedeck/dataclasses.py - Config models → Template renderer: uses templates
src/homedeck/dataclasses.py - Config models → Style utilities: uses helpers
src/homedeck/dataclasses.py - Page and button elements → Template renderer: renders content
src/homedeck/elements.py - Page and button elements → Icon renderer: builds icons
src/homedeck/elements.py - Page and button elements → Config models: uses button models
src/homedeck/elements.py - Deck controller → Page and button elements: updates pages
src/homedeck/homedeck.py - Deck controller → Physical deck: controls device
src/homedeck/homedeck.py - Physical deck → Deck controller: sends interactions
- Deck controller → HA WebSocket client: connects and reacts
src/homedeck/homedeck.py - HA WebSocket client → Home Assistant: exchanges WebSocket messages
src/homedeck/home_assistant.py - Deck controller → Event bus: uses event bus
src/homedeck/homedeck.py - Management API → Configuration schema: serves schema
server.py