From a71c5c159d04bae72c2aab9d92b5433aeb0c4d38 Mon Sep 17 00:00:00 2001 From: Eric Callahan Date: Tue, 24 Oct 2023 19:32:24 -0400 Subject: [PATCH] spoolman: filter spool_id before setting it active Signed-off-by: Eric Callahan --- moonraker/components/spoolman.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/moonraker/components/spoolman.py b/moonraker/components/spoolman.py index 8e6e5321d..a403a30aa 100644 --- a/moonraker/components/spoolman.py +++ b/moonraker/components/spoolman.py @@ -107,6 +107,9 @@ async def _handle_status_update(self, status: Dict[str, Any], _: float) -> None: await self.track_filament_usage() async def set_active_spool(self, spool_id: Optional[int]) -> None: + if self.spool_id == spool_id: + logging.info(f"Spool ID already set to: {spool_id}") + return # Store the current spool usage before switching if self.spool_id is not None: await self.track_filament_usage()