# circuitsforfun/esp_hue architecture

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

- Interactive diagram: https://gitdiagram.com/circuitsforfun/esp_hue
- Repository: https://github.com/circuitsforfun/esp_hue

## Overview

ESP Hue is a small Arduino library for controlling Philips Hue lights and groups from an ESP8266. A sketch uses the ESPHue API to read device information or state, and to send power, color, brightness, temperature, and transition settings to the Hue bridge. The implementation uses a caller-supplied WiFiClient for HTTP requests. The excerpts show light and group state methods calling their respective info methods; other method-level details are documented in the README. Example sketches are not included as runtime components.

Main entry points: [`src/ESPHue.cpp`](https://github.com/circuitsforfun/esp_hue/blob/master/src/ESPHue.cpp) (Light info and state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_light["Light API"]
  node_light_read["Light info and state<br/>[ESPHue.cpp]"]
  node_light_control["Light controls<br/>[ESPHue.cpp]"]
end

subgraph group_group["Group API"]
  node_group_read["Group info and state<br/>[ESPHue.cpp]"]
  node_group_control["Group controls<br/>[ESPHue.cpp]"]
end

node_sketch(("Arduino sketch"))
node_wifi["WiFiClient"]
node_bridge["Hue bridge"]

node_sketch -->|"calls"| node_light_read
node_sketch -->|"calls"| node_light_control
node_sketch -->|"calls"| node_group_read
node_sketch -->|"calls"| node_group_control
node_light_read -->|"state calls info"| node_light_read
node_group_read -->|"state calls info"| node_group_read
node_light_read -->|"sends HTTP"| node_wifi
node_light_control -->|"sends HTTP"| node_wifi
node_group_read -->|"sends HTTP"| node_wifi
node_group_control -->|"sends HTTP"| node_wifi
node_wifi -->|"connects and sends"| node_bridge

click node_light_read "https://github.com/circuitsforfun/esp_hue/blob/master/src/ESPHue.cpp"
click node_light_control "https://github.com/circuitsforfun/esp_hue/blob/master/src/ESPHue.cpp"
click node_group_read "https://github.com/circuitsforfun/esp_hue/blob/master/src/ESPHue.cpp"
click node_group_control "https://github.com/circuitsforfun/esp_hue/blob/master/src/ESPHue.cpp"

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_light_read,node_light_control,node_wifi toneBlue
class node_group_read,node_group_control toneAmber
class node_sketch,node_bridge toneIndigo
```

## Components

### Light API

- [Light info and state](https://github.com/circuitsforfun/esp_hue/blob/master/src/ESPHue.cpp): `src/ESPHue.cpp`
- [Light controls](https://github.com/circuitsforfun/esp_hue/blob/master/src/ESPHue.cpp): `src/ESPHue.cpp`

### Group API

- [Group info and state](https://github.com/circuitsforfun/esp_hue/blob/master/src/ESPHue.cpp): `src/ESPHue.cpp`
- [Group controls](https://github.com/circuitsforfun/esp_hue/blob/master/src/ESPHue.cpp): `src/ESPHue.cpp`

### Other components

- **Arduino sketch**
- **WiFiClient**
- **Hue bridge**

## Connections

- Arduino sketch → Light info and state: calls (evidence: `README.adoc`)
- Arduino sketch → Light controls: calls (evidence: `README.adoc`)
- Arduino sketch → Group info and state: calls (evidence: `README.adoc`)
- Arduino sketch → Group controls: calls (evidence: `README.adoc`)
- Light info and state → Light info and state: state calls info (evidence: `src/ESPHue.cpp`)
- Group info and state → Group info and state: state calls info (evidence: `src/ESPHue.cpp`)
- Light info and state → WiFiClient: sends HTTP (evidence: `src/ESPHue.cpp`)
- Light controls → WiFiClient: sends HTTP (evidence: `src/ESPHue.cpp`)
- Group info and state → WiFiClient: sends HTTP (evidence: `src/ESPHue.cpp`)
- Group controls → WiFiClient: sends HTTP (evidence: `src/ESPHue.cpp`)
- WiFiClient → Hue bridge: connects and sends
