# studioimaginaire/phue architecture

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

- Interactive diagram: https://gitdiagram.com/studioimaginaire/phue
- Repository: https://github.com/studioimaginaire/phue

## Overview

phue is a dependency-free, single-file Python client for Philips Hue bridges. A Python application uses the Bridge API to read and control lights and groups, manage schedules, scenes, and sensors, and work with object-oriented Light and Group representations or procedural methods. The Bridge communicates with the Hue API; sensor state and configuration wrappers forward updates through Bridge methods. The source index identifies only phue.py as a core module. Relationships among the broader documented capabilities are not expanded beyond what the README or excerpts support.

Main entry points: [`phue.py`](https://github.com/studioimaginaire/phue/blob/master/phue.py) (Bridge API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_app(("Python application"))
node_bridge["Bridge API client<br/>[phue.py]"]
node_lights["Light control<br/>[phue.py]"]
node_groups["Group control<br/>[phue.py]"]
node_schedules["Schedule management<br/>[phue.py]"]
node_scenes["Scene management<br/>[phue.py]"]
node_sensors["Sensor management<br/>[phue.py]"]
node_sensor_wrappers["Sensor state wrappers<br/>[phue.py]"]
node_hue["Hue Bridge"]

node_app -->|"uses"| node_bridge
node_bridge -->|"controls"| node_lights
node_bridge -->|"manages"| node_groups
node_bridge -->|"manages"| node_schedules
node_bridge -->|"manages"| node_scenes
node_bridge -->|"manages"| node_sensors
node_sensor_wrappers -->|"updates via"| node_sensors
node_bridge -->|"uses API"| node_hue

click node_bridge "https://github.com/studioimaginaire/phue/blob/master/phue.py"
click node_lights "https://github.com/studioimaginaire/phue/blob/master/phue.py"
click node_groups "https://github.com/studioimaginaire/phue/blob/master/phue.py"
click node_schedules "https://github.com/studioimaginaire/phue/blob/master/phue.py"
click node_scenes "https://github.com/studioimaginaire/phue/blob/master/phue.py"
click node_sensors "https://github.com/studioimaginaire/phue/blob/master/phue.py"
click node_sensor_wrappers "https://github.com/studioimaginaire/phue/blob/master/phue.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_app,node_hue toneIndigo
class node_bridge toneBlue
class node_lights,node_groups,node_schedules,node_scenes,node_sensors,node_sensor_wrappers toneTeal
```

## Components

### Other components

- **Python application**
- [Bridge API client](https://github.com/studioimaginaire/phue/blob/master/phue.py): `phue.py`
- [Light control](https://github.com/studioimaginaire/phue/blob/master/phue.py): `phue.py`
- [Group control](https://github.com/studioimaginaire/phue/blob/master/phue.py): `phue.py`
- [Schedule management](https://github.com/studioimaginaire/phue/blob/master/phue.py): `phue.py`
- [Scene management](https://github.com/studioimaginaire/phue/blob/master/phue.py): `phue.py`
- [Sensor management](https://github.com/studioimaginaire/phue/blob/master/phue.py): `phue.py`
- [Sensor state wrappers](https://github.com/studioimaginaire/phue/blob/master/phue.py): `phue.py`
- **Hue Bridge**

## Connections

- Python application → Bridge API client: uses (evidence: `README.md`)
- Bridge API client → Light control: controls (evidence: `README.md`)
- Bridge API client → Group control: manages (evidence: `README.md`)
- Bridge API client → Schedule management: manages (evidence: `README.md`)
- Bridge API client → Scene management: manages (evidence: `README.md`)
- Bridge API client → Sensor management: manages (evidence: `README.md`)
- Sensor state wrappers → Sensor management: updates via (evidence: `phue.py`)
- Bridge API client → Hue Bridge: uses API (evidence: `README.md`)
