Skip to content

feat: add nightlight control support for Haiku H/I uplight fans#189

Open
jhesketh wants to merge 2 commits into
jfroy:mainfrom
jhesketh:feature/nightlight-control
Open

feat: add nightlight control support for Haiku H/I uplight fans#189
jhesketh wants to merge 2 commits into
jfroy:mainfrom
jhesketh:feature/nightlight-control

Conversation

@jhesketh

Copy link
Copy Markdown
Contributor

Add NightlightProperties support discovered on Haiku H/I Series fans with an uplight module, where firmware reports a nightlight sub-message at Properties field 83. The library now models color (83.1), enabled (83.2), and brightness_percent (83.3) in proto and generated Python bindings.

Expose device APIs has_nightlight, nightlight_color, nightlight_enabled, and nightlight_brightness_percent as read/write properties. Writes use a pre-populated sub-message copy helper so partial updates do not reset sibling nightlight fields, and devices that do not expose field 83 continue returning None gracefully.

Disclaimer: This commit was developed with assistance from Claude and Codex and is based on reverse-engineering/experimentation on limited hardware. Please review carefully and validate behavior on your own target devices before relying on it.

@CLAassistant

CLAassistant commented Feb 22, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Add NightlightProperties support discovered on Haiku H/I Series fans with an uplight module, where firmware reports a nightlight sub-message at Properties field 83. The library now models color (83.1), enabled (83.2), and brightness_percent (83.3) in proto and generated Python bindings.

Expose device APIs has_nightlight, nightlight_color, nightlight_enabled, and nightlight_brightness_percent as read/write properties. Writes use a pre-populated sub-message copy helper so partial updates do not reset sibling nightlight fields, and devices that do not expose field 83 continue returning None gracefully.

Disclaimer: This commit was developed with assistance from Claude and Codex and is based on reverse-engineering/experimentation on limited hardware. Please review carefully and validate behavior on your own target devices before relying on it.
Add canonical library constants for the experimentally verified nightlight palette used by Haiku H/I uplight-capable devices: NIGHTLIGHT_COLOR_MAP plus NIGHTLIGHT_COLOR_MIN/MAX. This maps values 1-9 to user-facing color names and makes the valid range explicit for integrations.

Also update proto comments to record device behavior for out-of-range values (>=10 turns light off, 0 ignored) and re-export the constants from aiobafi6.__init__ so downstream consumers can build stable UI and validation without hardcoding magic numbers.

Disclaimer: This commit was developed with assistance from Claude and Codex and is based on reverse-engineering/experimentation on limited hardware. Please review carefully and validate behavior on your own target devices before relying on it.
@jfroy
jfroy force-pushed the feature/nightlight-control branch from dbeefc7 to bd22516 Compare February 24, 2026 04:13
@jfroy

jfroy commented Feb 24, 2026

Copy link
Copy Markdown
Owner

Please rebase with your other PR which is now in main.

Also, does this need the subfield merge fix as well?

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.

3 participants