Implement reusable AdaptiveLightingController.
HAP-python PR #428 added the HomeKit characteristics required to advertise Adaptive Lighting, along with a minimal demonstration accessory. It does not currently decode, track, or evaluate the transition schedule supplied through the TransitionControl characteristic.
I would like to implement a reusable, protocol-oriented AdaptiveLightingController, using the HAP-NodeJS implementation as a behavioral reference.
Proposed initial scope:
- Configure and manage the Adaptive Lighting characteristics on a Lightbulb service
- Decode and encode the Base64/TLV8 TransitionControl messages
- Handle transition read, update, renewal, and disable operations
- Validate referenced characteristic IDs and transition configuration
- Store the active transition curve in memory
- Calculate the current interpolated transition point
- Apply brightness-dependent color-temperature adjustments
- Clamp results to the light’s advertised color-temperature range
- Expose callbacks for transition activation, renewal, and disable events
- Expose an explicit method consumers can call after detecting a manual color change
- Serialize and restore controller state while leaving the persistence backend to the consumer
- Include protocol, interpolation, serialization, and lifecycle tests
The initial implementation would require Brightness and ColorTemperature characteristics.
Consumers such as Home Assistant would be responsible for scheduling evaluations, applying the calculated temperature to a device, detecting external manual changes, and storing the controller’s serialized state.
Would this protocol-oriented boundary be appropriate for HAP-python? Is there a preferred callback or serialization API that the implementation should follow?
Implement reusable AdaptiveLightingController.
HAP-python PR #428 added the HomeKit characteristics required to advertise Adaptive Lighting, along with a minimal demonstration accessory. It does not currently decode, track, or evaluate the transition schedule supplied through the TransitionControl characteristic.
I would like to implement a reusable, protocol-oriented AdaptiveLightingController, using the HAP-NodeJS implementation as a behavioral reference.
Proposed initial scope:
The initial implementation would require Brightness and ColorTemperature characteristics.
Consumers such as Home Assistant would be responsible for scheduling evaluations, applying the calculated temperature to a device, detecting external manual changes, and storing the controller’s serialized state.
Would this protocol-oriented boundary be appropriate for HAP-python? Is there a preferred callback or serialization API that the implementation should follow?