strings.json + translations/en.json:
- Rewritten from scratch with plain-language labels and one-sentence
framers per section (Targets / Daytime curve / Sun schedule / Light
control / Advanced / Diagnostics).
- Per-field `data_description` for every visible option in the options
flow.
- New translations for `yaml_managed` abort and the version-incompatible
error.
- Removed every key for the 21 dropped fields and the sleep switch.
- Services section updated for the trimmed surface: dropped
`set_manual_control` entirely, removed all sleep / take-over /
sunrise-sunset-time keys from `change_switch_settings`.
services.yaml: rewritten by hand (was auto-generated upstream). Now
matches the fork's actual service surface: `apply` and
`change_switch_settings` only, with native HA selectors and units.
README: added a CDiT preamble at the top covering the five core
differences from upstream, the strict-version-break warning, the
recommended Sun2 companion, and the minimum HA version pin. Crucially,
also added a "🙏 Huge thanks to the upstream team" block that names
@basnijholt and the 130+ upstream contributors, points users at the
upstream repo for the canonical install, and routes core-curve / light-
handling bugs to upstream's tracker. Open-source credit done right.
CHANGELOG.md: new file. Header credits upstream up front; v2.0.0-cdit.1
section lists every Added / Changed / Removed item by name, the
migration / upgrade steps in numbered form, internal refactors, and
known limitations (Manager bridge stubs, locale drift, astral as
transitive dep).
tasks.md: 8.1-8.6 and 9.1-9.3 marked complete; 9.4 (GitHub repo
description) deferred to a separate `gh repo edit` step.
openspec validate cdit-config-redesign --strict: green.
JSON + YAML syntax: validated.
Module import: clean.
7.3 KiB
Changelog — CDiT Adaptive Lighting fork
All notable CDiT-fork changes are documented here. The upstream
basnijholt/adaptive-lighting changelog is in upstream's release notes; this
file covers only changes specific to this fork.
The format is loosely based on Keep a Changelog.
Standing on the shoulders of giants
This fork builds on basnijholt/adaptive-lighting — years of work by @basnijholt and 130+ contributors. The curve math, light intercept, HACS distribution, simulator webapp, and the long tail of edge cases the original handles correctly all come from that codebase. This fork is a narrow set of opinions layered on a deep, mature foundation; the credit for making this idea work at all belongs upstream.
If you're not specifically a CDiT-style single-household installation, please prefer the upstream integration — it's better-maintained, supports more use cases, and has the entire community behind it. Issues with core curve math or light handling belong on the upstream tracker, where they reach the maintainers who can actually fix them for everyone.
[2.0.0-cdit.1] — Unreleased
The first major CDiT release. Breaking change: existing upstream config entries will not load — see "Upgrading" below.
Added
- Sectioned options dialog rendered via HA's
section()helper. Six groups (Targets, Daytime curve, Sun schedule, Light control, Advanced, Diagnostics) replace the upstream 40-field flat form. - Native HA selectors throughout —
NumberSelector(slider for brightness 1–100 %, box for color temp 1000–10000 K),EntitySelector(typed todomain=sensor, device_class=timestampfor sun events,domain=light, multiple=Truefor the light list),BooleanSelector. - Conditional field visibility —
send_split_delayonly appears when its driverseparate_turn_on_commandsis enabled. - Entity-driven sun timing — two new options
sunrise_entityandsunset_entityaccept any sensor withdevice_class: timestamp. Defaults to the built-insensor.sun_next_rising/sensor.sun_next_setting. Plug in Sun2 (sensor.sun2_dawn,sensor.sun2_astro_dawn, etc.) without any code changes. - Synthetic tanh brightness/color-temp curve with a hardcoded 30-minute
ramp half-width around each sun event. Tunable in
const.pyviaRAMP_HALF_WIDTH_SECONDS(currently1800). OptionsFlowWithReload— saving options reloads the integration cleanly without a manual reload.- Strict version-break guard —
async_setup_entryraisesConfigEntryErrorwith a clear message when a config entry's version is older than the current major. - Sleep-switch tombstone cleanup — on first load after upgrade,
orphan
switch.adaptive_lighting_sleep_mode_*entities owned by this integration are removed from the entity registry and logged atINFO. - Plain-language strings — every label, description, and abort message rewritten to read like a sentence a human wrote, not engineer shorthand. Sections get a one-sentence framer at the top.
Changed
DEFAULT_MIN_BRIGHTNESS:1→5. 1 % reads as off on most bulbs; 5 % is the dim-but-visible floor.DEFAULT_MIN_COLOR_TEMP:2000 K→2200 K. Less sodium-vapor orange; warmer-lamp tone.- Master switch icon:
mdi:theme-light-dark→mdi:weather-sunny-alert. adapt_colorswitch icon:mdi:sun-thermometer→mdi:invert-colors.adapt_brightnessswitch icon:mdi:brightness-4→mdi:brightness-percent.- Minimum Home Assistant version: pinned to
2025.1.0inmanifest.json. - Manifest metadata —
codeowners,documentation, andissue_trackernow point toCaseyRo/adaptive-lighting.
Removed
21 configuration fields, 1 entity, 1 service, all part of upstream features that the CDiT fork does not use.
- Sleep mode cluster (6 fields + 1 entity):
sleep_brightness,sleep_rgb_or_color_temp,sleep_color_temp,sleep_rgb_color,sleep_transition,transition_until_sleep. Theswitch.adaptive_lighting_sleep_mode_<name>entity is no longer created. Each profile now provides three switches (master, adapt_color, adapt_brightness) instead of four. - Manual sun timing (8 fields):
sunrise_time,min_sunrise_time,max_sunrise_time,sunrise_offset,sunset_time,min_sunset_time,max_sunset_time,sunset_offset. Replaced by the two*_entityoptions above. - Brightness curve shape (3 fields):
brightness_mode,brightness_mode_time_dark,brightness_mode_time_light. The curve is now always a tanh ramp. - Take-over-control cluster (4 fields):
take_over_control,take_over_control_mode,detect_non_ha_changes,autoreset_control_seconds. Manual overrides are expected to live at the scene/automation layer. - Anti-AL flags (2 fields):
only_once,adapt_only_on_bare_turn_on. If you don't want continuous adaptation on a light, don't run AL on that light. - Service:
adaptive_lighting.set_manual_controlno longer exists. The dependent state machine inswitch.pyandAdaptiveLightingManagerremains as dead code in this release; follow-up cleanup will delete it.
Migration / upgrading from upstream
- Update via HACS (or copy
custom_components/adaptive_lighting/over your existing install). - Restart Home Assistant.
- The existing config entry shows as "failed to load" with the message "Adaptive Lighting v2 (CDiT fork) is incompatible with the existing config entry."
- Delete the failed entry: Settings → Devices & Services → Adaptive Lighting → ⋮ → Delete.
- Add a fresh entry: Settings → Devices & Services → Add Integration → Adaptive Lighting.
- Open the new entry's Configure dialog and walk through the six sections.
- (Optional) Install Sun2 via
HACS and point
sunrise_entity/sunset_entityat one of its sensors.
Internal
color_and_brightness.py: rewritten.SunLightSettingsis now a pure curve-math dataclass with 5 fields. Sun event timestamps are passed in as arguments by the caller (which reads them from HA entities) rather than computed viaastral.config_flow.py: rewritten. ~250 LOC instead of 175 LOC, but each section, selector factory, and conditional is now isolated and testable.__init__.py: adds version-check + tombstone-cleanup guards at the top ofasync_setup_entry.- Total integration code shrank by ~400 LOC despite the new schema builder.
Known limitations
AdaptiveLightingManager(inswitch.py) still contains the manual-control bookkeeping infrastructure. The branches that would populate it are now dead code (the relevantAdaptiveSwitchattributes are bridge stubs hardcoded toFalse), but the bookkeeping dicts and helper methods remain. Cleanup is deferred to a follow-up change.- Locale files other than
en.jsonare out of sync with the new schema and may render English strings until they are re-translated. Out of scope for this release. astralis still a transitive dependency. The curve-evaluation path no longer imports it, so pruning is just apyproject.tomledit when the package as a whole stops using it.