mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-19 15:54:27 +02:00
- 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:
+2
-1
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 = [
|
||||
|
||||
Reference in New Issue
Block a user