Skip to content

Add Adaptive Lighting for lightbulbs - #217

Draft
yfre wants to merge 1 commit into
masterfrom
feature/adaptive-lighting
Draft

yfre wants to merge 1 commit into
masterfrom
feature/adaptive-lighting

Conversation

@yfre

@yfre yfre commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Adds Adaptive Lighting for lightbulbs. A HomeKit controller sends a 24-hour color temperature curve; AdaptiveLightingController applies it in the requested interval, adjusted to the current brightness, through an AdaptiveLightingHandler.

Supporting changes:

  • CharacteristicsController.put answers writes with "r": true with 207 and the value, via the new WriteResponseCharacteristic. Without r it still returns 204.
  • HomekitRegistry stores each characteristic's instance id on BaseCharacteristic; the supported transition configuration has to name the ids of Brightness and ColorTemperature.
  • IntegerCharacteristic.getMinValue() / getMaxValue(), to keep the color temperature within the characteristic's range.
  • TLV8 reader/writer and characteristic, package-private.

No breaking API changes; everything is additive.

Adds AdaptiveLightingController, which receives the color temperature
curve from a HomeKit controller and applies it through a handler.
Supporting changes: writes with response ("r": true) answered with 207,
instance ids stored on characteristics, TLV8 characteristic values.
@yfre

yfre commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

Tested with the Home app (iOS, with a home hub). The Adaptive Lighting option did not appear for the bulb, so the curve handling could not be tested end to end.

What was checked:

  • The bridge serves the three characteristics (0x144, 0x143, 0x24B) with the same format, permissions and TLV bytes as HAP-NodeJS.
  • The home hub reads them and subscribes to 0x24B, but never writes a curve to 0x143.
  • Pairing, on/off, brightness and color temperature work as before.
  • Re-pairing into a newly created home gives the same result.

Cross-check with HAP-NodeJS 2.3.0: its own Adaptive Lighting example bulb, bridged and in the same home, also gets no Adaptive Lighting option, and the hub behaves the same way. So the missing option comes from the Home/hub setup, not from this change.

Keeping the PR as a draft until it can be tested on a setup where Adaptive Lighting shows up.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant