Skip to content

Improve Chamber Lighting Functionality#5180

Open
holdenkilbride wants to merge 3 commits intoprusa3d:masterfrom
holdenkilbride:lighting-improvement
Open

Improve Chamber Lighting Functionality#5180
holdenkilbride wants to merge 3 commits intoprusa3d:masterfrom
holdenkilbride:lighting-improvement

Conversation

@holdenkilbride
Copy link
Copy Markdown

Replace chamber lighting dimming toggle with three-level brightness control

Summary

Replaces the binary DimmingEnabled setting (Never / Always / On Idle) with three independent brightness levels for chamber lighting: interaction brightness, print brightness, and idle brightness. This gives users granular control over lighting behavior across all printer states without sacrificing simplicity.

Problem

The previous implementation had two configurable values — a maximum brightness and a dimmed brightness — gated by a three-way enum toggle. This created several UX problems:

  • No way to set a distinct brightness for active printing vs. true idle; "On Idle" dimming applied the same dimmed level to both
  • "Never" and "Always" modes were confusing — "Never" disabled dimming entirely (always full brightness), "Always" dimmed regardless of print state
  • The dimmed brightness slider was hidden/disabled when dimming was set to "Never", leading to settings that silently did nothing
  • Users wanting comfortable printing illumination without blinding idle brightness had no clean way to configure it

Changes

side_strip_handler

  • Adds a new printing state to SideStripState alongside the existing dimmed and active states
  • Replaces DimmingEnabled dimming_enabled member with uint8_t print_brightness
  • Updates update() logic: when activity timeout expires, transitions to printing state if a print is active, otherwise dimmed; the active state is only
    entered on user interaction if max_brightness > baseline (prevents a pointless flash to active when interaction brightness is already at or below current
    brightness)
  • get_color_for_state() handles the new printing state, clamping to print_brightness

Config store

  • Removes side_leds_dimming_enabled (migrated to DeprecatedStore)
  • Adds side_leds_print_brightness (default 255 — full brightness during prints, preserving existing behavior for users upgrading)
  • side_leds_dimmed_brightness and side_leds_max_brightness retain their existing hash keys for backward compatibility

Menu items

  • Removes MI_SIDE_LEDS_DIMMING_ENABLE (the three-way toggle)
  • Adds MI_SIDE_LEDS_PRINT_BRIGTHNESS spinner (0–100%)
  • Renames labels for clarity: "Chamber Lights" → "Chamber Brightness", "Chamber Lights Dimmed" → "Idle Brightness", new item "Print Brightness"
  • MI_SIDE_LEDS_DIMMED_BRIGTHNESS::Loop() now enforces that idle brightness cannot exceed chamber brightness, auto-clamping and saving if needed

Behavior after this change

Printer state Brightness used
User interacting (door, knob, touch) Chamber Brightness
Printing, activity timeout elapsed Print Brightness
Idle, activity timeout elapsed Idle Brightness (≤ Chamber Brightness)

Upgrade path

Existing users upgrading from firmware with DimmingEnabled:

  • side_leds_dimming_enabled is deprecated and migrated away; existing max/dimmed brightness values are preserved
  • Print brightness defaults to 255 (full), matching the previous behavior of "On Idle" mode where printing was never dimmed

Testing

  • Verify all three brightness levels apply correctly by transitioning between idle, printing, and interaction states
  • Verify idle brightness is auto-clamped when set above chamber brightness via the menu
  • Verify settings persist across power cycles
  • Verify upgrade from previous firmware does not reset brightness preferences

Fixes #5179
IMG_4317

@holdenkilbride holdenkilbride changed the title save work from worktree Improve Chamber Lighting Functionality Mar 19, 2026
Replaces the DimmingEnabled toggle (Never/Always/On Idle) with three
independent brightness levels:

- Chamber Brightness: on user interaction (door, knob, touch)
- Print Brightness: during active print, after activity timeout
- Idle Brightness: when not printing, after activity timeout

Previously there was no way to set distinct brightness for printing vs.
idle states. The On Idle mode applied the same dimmed level to both,
meaning users could not keep the chamber well-lit during a print while
dimming at night when idle.

Adds SideStripState::printing alongside the existing dimmed and active
states. The active state is now only entered when max_brightness exceeds
the current baseline, preventing a pointless brightness flash on
interaction when chamber brightness is already at or below baseline.

Idle brightness is clamped in the menu to not exceed chamber brightness.

side_leds_dimming_enabled is moved to DeprecatedStore for backward
compatibility. Print brightness defaults to 255 to preserve behavior
for users upgrading from the previous firmware.
@bkerler
Copy link
Copy Markdown

bkerler commented Mar 28, 2026

Some things I noticed:

  1. The upgrade path does not actually preserve prior “Always” dimming behavior. side_leds_dimming_enabled is only deprecated, not migrated into the new side_leds_print_brightness, and the new print-brightness item defaults to 255. Users who previously had DimmingEnabled::always will therefore be changed from “dim during printing” to “full brightness during printing” after upgrade.

  2. The new “idle brightness must not exceed chamber brightness” rule is enforced only in the menu widget loop. load_config(), set_max_brightness(), and set_dimmed_brightness() never clamp persisted/runtime values, so upgraded configs or connect-driven brightness changes can still leave idle brightness above chamber brightness until someone opens that menu screen.

@holdenkilbride
Copy link
Copy Markdown
Author

@bkerler Would you happen to know when the master branch gets updated with the release code?

@bkerler
Copy link
Copy Markdown

bkerler commented Mar 30, 2026

The latest code is always released in the tags, but community development mainly happens in master. Master is normally updated after major releases, I'd expect the next master to be 6.6.0.

holdenkilbride and others added 2 commits March 30, 2026 14:09
…bled::always

now have side_leds_print_brightness set to their configured dimmed_brightness,
preserving the intent that LEDs dim during printing after upgrade.
Enforce the idle-brightness-must-not-exceed-chamber-brightness invariant in
load_config(), set_max_brightness(), and set_dimmed_brightness() so it holds
 regardless of how values arrive, not only when the menu widget Loop() runs.
Add migration for side_leds_dimming_enabled: users who had DimmingEna…
@holdenkilbride
Copy link
Copy Markdown
Author

@bkerler I updated the code per your notes/observations. I tested on my Core One and verified the setting upgrade paths worked correctly. Thank you for your review!

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.

[ENHANCEMENT] Enhance options for chamber lighting during interaction, printing, and idle

2 participants