# teh-hippo/ha-govee-led-ble architecture

> Architecture diagram of the GitHub repository teh-hippo/ha-govee-led-ble, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/teh-hippo/ha-govee-led-ble
- Repository: https://github.com/teh-hippo/ha-govee-led-ble

## Overview

Govee LED BLE is a Home Assistant integration for local Bluetooth control of supported Govee lights, with Effect Studio for browsing scenes, editing and saving effects, and live preview. The user workflow begins with automatic discovery or adding the integration, then controls devices through Home Assistant entities and Effect Studio. The README also documents projector-specific controls, native segment canvases, and music/video effect settings. The graph combines those documented capabilities with sampled module relationships; unsampled subsystem links are omitted where their wiring is not shown.

Main entry points: [`frontend/src/panel-controller.ts`](https://github.com/teh-hippo/ha-govee-led-ble/blob/master/frontend/src/panel-controller.ts) (Studio panel), [`custom_components/ha_govee_led_ble/coordinator.py`](https://github.com/teh-hippo/ha-govee-led-ble/blob/master/custom_components/ha_govee_led_ble/coordinator.py) (Device coordinator), [`custom_components/ha_govee_led_ble/protocol_core.py`](https://github.com/teh-hippo/ha-govee-led-ble/blob/master/custom_components/ha_govee_led_ble/protocol_core.py) (Device protocol), [`custom_components/ha_govee_led_ble/light.py`](https://github.com/teh-hippo/ha-govee-led-ble/blob/master/custom_components/ha_govee_led_ble/light.py) (Light entities)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_integration["Home Assistant integration"]
  node_setup["Setup and discovery<br/>[config_flow.py]"]
  node_coordinator["Device coordinator<br/>[coordinator.py]"]
  node_entities["Light entities<br/>[light.py]"]
  node_services["Light services<br/>[light_services.py]"]
end

subgraph group_device["BLE device protocol"]
  node_ble["BLE transport<br/>[transport.py]"]
  node_protocol["Device protocol<br/>[protocol_core.py]"]
  node_crypto["Govee encryption<br/>[__init__.py]"]
  node_capabilities["Model capabilities<br/>[const.py]"]
end

subgraph group_effects["Effects and scenes"]
  node_scenes["Scenes and layouts<br/>[scenes.py]"]
  node_effect_domain["Effect definitions<br/>[effect_domain.py]"]
  node_effect_storage[("Saved effects<br/>[effect_storage.py]")]
  node_preview["Live preview<br/>[effect_preview.py]"]
end

subgraph group_studio["Effect Studio"]
  node_panel["Studio panel"]
  node_editor["Effect editor"]
  node_scene_browser["Scene browser<br/>[scene-browser.ts]"]
  node_preview_ui["Preview controller"]
  node_api["Studio API<br/>[api.ts]"]
end

node_user(("Home Assistant user"))
node_ha["Home Assistant"]

node_user -->|"uses"| node_ha
node_ha -->|"adds integration"| node_setup
node_setup -.->|"connects device"| node_coordinator
node_coordinator -.->|"provides state"| node_entities
node_user -->|"controls lights"| node_entities
node_entities -.->|"invokes controls"| node_services
node_services -.->|"sends commands"| node_ble
node_ble -.->|"exchanges frames"| node_protocol
node_protocol -.->|"uses crypto"| node_crypto
node_coordinator -.->|"uses model data"| node_capabilities
node_user -->|"opens Studio"| node_panel
node_panel -->|"coordinates editing"| node_editor
node_panel -->|"coordinates browsing"| node_scene_browser
node_panel -->|"coordinates preview"| node_preview_ui
node_scene_browser -->|"loads catalogue"| node_api
node_preview_ui -->|"submits preview"| node_api
node_editor -.->|"edits definitions"| node_effect_domain
node_user -->|"chooses scenes"| node_scenes
node_user -->|"previews effects"| node_preview
node_user -->|"saves effects"| node_effect_storage
node_effect_storage -->|"validates items"| node_effect_domain
node_protocol -.->|"encodes scenes"| node_scenes

click node_setup "https://github.com/teh-hippo/ha-govee-led-ble/blob/master/custom_components/ha_govee_led_ble/config_flow.py"
click node_coordinator "https://github.com/teh-hippo/ha-govee-led-ble/blob/master/custom_components/ha_govee_led_ble/coordinator.py"
click node_entities "https://github.com/teh-hippo/ha-govee-led-ble/blob/master/custom_components/ha_govee_led_ble/light.py"
click node_services "https://github.com/teh-hippo/ha-govee-led-ble/blob/master/custom_components/ha_govee_led_ble/light_services.py"
click node_ble "https://github.com/teh-hippo/ha-govee-led-ble/blob/master/custom_components/ha_govee_led_ble/transport.py"
click node_protocol "https://github.com/teh-hippo/ha-govee-led-ble/blob/master/custom_components/ha_govee_led_ble/protocol_core.py"
click node_crypto "https://github.com/teh-hippo/ha-govee-led-ble/blob/master/custom_components/ha_govee_led_ble/govee_encryption/__init__.py"
click node_capabilities "https://github.com/teh-hippo/ha-govee-led-ble/blob/master/custom_components/ha_govee_led_ble/const.py"
click node_scenes "https://github.com/teh-hippo/ha-govee-led-ble/blob/master/custom_components/ha_govee_led_ble/scenes.py"
click node_effect_domain "https://github.com/teh-hippo/ha-govee-led-ble/blob/master/custom_components/ha_govee_led_ble/effect_domain.py"
click node_effect_storage "https://github.com/teh-hippo/ha-govee-led-ble/blob/master/custom_components/ha_govee_led_ble/effect_storage.py"
click node_preview "https://github.com/teh-hippo/ha-govee-led-ble/blob/master/custom_components/ha_govee_led_ble/effect_preview.py"
click node_panel "https://github.com/teh-hippo/ha-govee-led-ble/blob/master/frontend/src/panel-controller.ts"
click node_editor "https://github.com/teh-hippo/ha-govee-led-ble/blob/master/frontend/src/panel-editor-controller.ts"
click node_scene_browser "https://github.com/teh-hippo/ha-govee-led-ble/blob/master/frontend/src/scene-browser.ts"
click node_preview_ui "https://github.com/teh-hippo/ha-govee-led-ble/blob/master/frontend/src/panel-preview-controller.ts"
click node_api "https://github.com/teh-hippo/ha-govee-led-ble/blob/master/frontend/src/api.ts"

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_setup,node_coordinator,node_entities,node_services,node_user toneBlue
class node_ble,node_protocol,node_crypto,node_capabilities toneAmber
class node_scenes,node_effect_domain,node_effect_storage,node_preview toneMint
class node_panel,node_editor,node_scene_browser,node_preview_ui,node_api toneRose
class node_ha toneIndigo
```

## Components

### Home Assistant integration

- [Setup and discovery](https://github.com/teh-hippo/ha-govee-led-ble/blob/master/custom_components/ha_govee_led_ble/config_flow.py): `custom_components/ha_govee_led_ble/config_flow.py`
- [Device coordinator](https://github.com/teh-hippo/ha-govee-led-ble/blob/master/custom_components/ha_govee_led_ble/coordinator.py): `custom_components/ha_govee_led_ble/coordinator.py`
- [Light entities](https://github.com/teh-hippo/ha-govee-led-ble/blob/master/custom_components/ha_govee_led_ble/light.py): `custom_components/ha_govee_led_ble/light.py`
- [Light services](https://github.com/teh-hippo/ha-govee-led-ble/blob/master/custom_components/ha_govee_led_ble/light_services.py): `custom_components/ha_govee_led_ble/light_services.py`

### BLE device protocol

- [BLE transport](https://github.com/teh-hippo/ha-govee-led-ble/blob/master/custom_components/ha_govee_led_ble/transport.py): `custom_components/ha_govee_led_ble/transport.py`
- [Device protocol](https://github.com/teh-hippo/ha-govee-led-ble/blob/master/custom_components/ha_govee_led_ble/protocol_core.py): `custom_components/ha_govee_led_ble/protocol_core.py`
- [Govee encryption](https://github.com/teh-hippo/ha-govee-led-ble/blob/master/custom_components/ha_govee_led_ble/govee_encryption/__init__.py): `custom_components/ha_govee_led_ble/govee_encryption/__init__.py`
- [Model capabilities](https://github.com/teh-hippo/ha-govee-led-ble/blob/master/custom_components/ha_govee_led_ble/const.py): `custom_components/ha_govee_led_ble/const.py`

### Effects and scenes

- [Scenes and layouts](https://github.com/teh-hippo/ha-govee-led-ble/blob/master/custom_components/ha_govee_led_ble/scenes.py): `custom_components/ha_govee_led_ble/scenes.py`
- [Effect definitions](https://github.com/teh-hippo/ha-govee-led-ble/blob/master/custom_components/ha_govee_led_ble/effect_domain.py): `custom_components/ha_govee_led_ble/effect_domain.py`
- [Saved effects](https://github.com/teh-hippo/ha-govee-led-ble/blob/master/custom_components/ha_govee_led_ble/effect_storage.py): `custom_components/ha_govee_led_ble/effect_storage.py`
- [Live preview](https://github.com/teh-hippo/ha-govee-led-ble/blob/master/custom_components/ha_govee_led_ble/effect_preview.py): `custom_components/ha_govee_led_ble/effect_preview.py`

### Effect Studio

- [Studio panel](https://github.com/teh-hippo/ha-govee-led-ble/blob/master/frontend/src/panel-controller.ts): `frontend/src/panel-controller.ts`
- [Effect editor](https://github.com/teh-hippo/ha-govee-led-ble/blob/master/frontend/src/panel-editor-controller.ts): `frontend/src/panel-editor-controller.ts`
- [Scene browser](https://github.com/teh-hippo/ha-govee-led-ble/blob/master/frontend/src/scene-browser.ts): `frontend/src/scene-browser.ts`
- [Preview controller](https://github.com/teh-hippo/ha-govee-led-ble/blob/master/frontend/src/panel-preview-controller.ts): `frontend/src/panel-preview-controller.ts`
- [Studio API](https://github.com/teh-hippo/ha-govee-led-ble/blob/master/frontend/src/api.ts): `frontend/src/api.ts`

### Other components

- **Home Assistant user**
- **Home Assistant**

## Connections

- Home Assistant user → Home Assistant: uses (evidence: `README.md`)
- Home Assistant → Setup and discovery: adds integration (evidence: `README.md`)
- Setup and discovery → Device coordinator: connects device
- Device coordinator → Light entities: provides state
- Home Assistant user → Light entities: controls lights (evidence: `README.md`)
- Light entities → Light services: invokes controls
- Light services → BLE transport: sends commands
- BLE transport → Device protocol: exchanges frames
- Device protocol → Govee encryption: uses crypto
- Device coordinator → Model capabilities: uses model data
- Home Assistant user → Studio panel: opens Studio (evidence: `README.md`)
- Studio panel → Effect editor: coordinates editing (evidence: `frontend/src/panel-controller.ts`)
- Studio panel → Scene browser: coordinates browsing (evidence: `frontend/src/panel-controller.ts`)
- Studio panel → Preview controller: coordinates preview (evidence: `frontend/src/panel-controller.ts`)
- Scene browser → Studio API: loads catalogue (evidence: `frontend/src/scene-browser.ts`)
- Preview controller → Studio API: submits preview (evidence: `frontend/src/panel-preview-controller.ts`)
- Effect editor → Effect definitions: edits definitions
- Home Assistant user → Scenes and layouts: chooses scenes (evidence: `README.md`)
- Home Assistant user → Live preview: previews effects (evidence: `README.md`)
- Home Assistant user → Saved effects: saves effects (evidence: `README.md`)
- Saved effects → Effect definitions: validates items (evidence: `custom_components/ha_govee_led_ble/effect_storage.py`)
- Device protocol → Scenes and layouts: encodes scenes
