- Fixed bug where chamber_light state was not included in WebSocket broadcasts, so the frontend never received updates when the printer's light state actually changed (only the optimistic update would show, which could be overwritten or stay stale)

This commit is contained in:
maziggy
2026-01-12 09:52:49 +01:00
parent bdf9518a72
commit 9ae25f4c6e
3 changed files with 6 additions and 3 deletions
+2 -1
View File
@@ -241,7 +241,8 @@ async def on_printer_status_change(printer_id: int, state: PrinterState):
f"{state.connected}:{state.state}:{state.progress}:{state.layer_num}:"
f"{nozzle_temp}:{bed_temp}:{nozzle_2_temp}:{chamber_temp}:"
f"{state.stg_cur}:{bed_target}:{nozzle_target}:"
f"{state.cooling_fan_speed}:{state.big_fan1_speed}:{state.big_fan2_speed}"
f"{state.cooling_fan_speed}:{state.big_fan1_speed}:{state.big_fan2_speed}:"
f"{state.chamber_light}"
)
if _last_status_broadcast.get(printer_id) == status_key:
return # No change, skip broadcast
+2
View File
@@ -504,6 +504,8 @@ def printer_state_to_dict(state: PrinterState, printer_id: int | None = None) ->
"big_fan1_speed": state.big_fan1_speed,
"big_fan2_speed": state.big_fan2_speed,
"heatbreak_fan_speed": state.heatbreak_fan_speed,
# Chamber light state
"chamber_light": state.chamber_light,
}
# Add cover URL if there's an active print and printer_id is provided
# Include PAUSE/PAUSED states so skip objects modal can show cover
+2 -2
View File
@@ -1,6 +1,6 @@
// Bambuddy Service Worker
const CACHE_NAME = 'bambuddy-v22';
const STATIC_CACHE = 'bambuddy-static-v22';
const CACHE_NAME = 'bambuddy-v23';
const STATIC_CACHE = 'bambuddy-static-v23';
// Static assets to cache on install
const STATIC_ASSETS = [