Skip to content

Allowing for sleep_brightness to be set to 0#1455

Open
jaynis wants to merge 6 commits intobasnijholt:mainfrom
jaynis:feature/0-sleep-brightness
Open

Allowing for sleep_brightness to be set to 0#1455
jaynis wants to merge 6 commits intobasnijholt:mainfrom
jaynis:feature/0-sleep-brightness

Conversation

@jaynis
Copy link
Copy Markdown

@jaynis jaynis commented Mar 26, 2026

This PR updates the sleep_brightness range from 1–100 to 0–100, enabling zero as a valid value. It allows lights to remain off when they receive turn_on calls during sleep mode and thus can prevent specific lights (e.g. ceiling lights) from turning on. This eliminates the need of special logic when e.g. turning on lights with motion sensors during night time.

Signed-off-by: jaynis <kranz.jannis@googlemail.com>
@jaynis jaynis requested a review from basnijholt as a code owner March 26, 2026 23:33
florianhorner pushed a commit to florianhorner/adaptive-lighting that referenced this pull request Apr 6, 2026
@basnijholt
Copy link
Copy Markdown
Owner

Sorry it took me so long to get to this. I've been a bit overwhelmed by the number of AI-assisted PRs opened here recently, and I've also been spending nearly every spare hour on my biggest project so far, MindRoom.

I'm very supportive of using AI for coding, but many of these PRs still need careful human review because even plausible-looking changes can introduce subtle breakage. That backlog made me postpone reviewing them for a while.

I've now done a batch review with Codex / GPT-5.5 (xhigh). This comment is AI-assisted, but I've reviewed the concern before posting it.

One issue before this can be merged: making sleep_brightness: 0 valid is incomplete on current main, because the split-command path still drops falsey brightness values.

Specifically, _split_service_call_data filters split data with if service_data.get(attribute), so with separate_turn_on_commands: true a brightness value of 0 is filtered out and the brightness command can be skipped. That means this new setting may not actually keep the light at zero brightness in the scenario where separate turn-on commands are needed.

The zero-value handling in #1460 fixes the underlying pattern by checking is not None. Could you either include that fix here, make this PR depend on/merge after #1460, and ideally add a regression test for sleep_brightness=0 with separate_turn_on_commands=True?

@jaynis
Copy link
Copy Markdown
Author

jaynis commented Apr 24, 2026

Hi @basnijholt and thank you for your review. I have implemented the mentioned changes and kindly ask you to take another look.

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.

2 participants