Introducing a new way to review your PRs.

Read the announcement

basnijholt / adaptive-lighting

Adaptive Lighting custom component for Home Assistant

View on GitHub

13 documents · Updated Oct 21, 2026

overview

Knowledge Base updated: 2026-10-20

Adaptive Lighting knowledge base

Orientation

Adaptive Lighting is a Home Assistant custom integration that continuously applies time-aware brightness and color settings to configured lights.

The core runtime lives in custom_components/adaptive_lighting/, where integration setup, configuration entries, adaptation calculations, light service handling, switches, and diagnostics share per-entry state.

Supporting preview tooling, tests, workflows, and integration metadata validate and deliver the component.

Architecture

flowchart TD
  HA[Home Assistant] --> Init[Integration lifecycle]
  Init --> Setup[Setup and coordination]
  HA --> Config[Configuration flow and options]
  Config --> Setup
  Setup --> Engine[Adaptive Lighting control engine]
  Engine --> Calc[Light adaptation calculations]
  Engine --> Commands[Light state and command handling]
  Commands --> Lights[Home Assistant light entities]
  HA --> Switches[Switches and service controls]
  Switches --> Engine
  Setup --> Diagnostics[Integration diagnostics]
  Tests[Tests and developer tooling] --> Engine
  Preview[Color and brightness preview app] --> Calc
  Workflows[Validation and release automation] --> Tests
  Workflows --> Metadata[Integration metadata]

Glossary

  • Adaptive Lighting instance: One configured integration entry and its associated runtime controls and managed lights.
  • Adaptation: The process of deriving desired brightness and color characteristics for a light at a given time.
  • Manual control: User or automation interaction that can affect whether and how a light continues to receive adaptive updates.
  • Config entry: Home Assistant’s persisted configuration record for an integration instance.

Invariants

  • Runtime state is scoped to configured integration entries, with setup and teardown coordinated through custom_components/…/__init__.py.
  • Light updates must respect each target’s reported capabilities and state before calling Home Assistant light services; see custom_components/adaptive_lighting/ light-handling modules.
  • User-facing configuration is represented through Home Assistant config entries and options flows in custom_components/…/config_flow.py.
  • Diagnostics must expose troubleshooting data without leaking sensitive configuration values; see custom_components/…/diagnostics.py.
  • Published integration metadata remains synchronized with its distributable files, including custom_components/…/manifest.json and repository automation.

Routing table