Skip to content

Commit

Permalink
spoolman: filter spool_id before setting it active
Browse files Browse the repository at this point in the history
Signed-off-by:  Eric Callahan <[email protected]>
  • Loading branch information
Arksine committed Oct 24, 2023
1 parent 17ffb44 commit a71c5c1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions moonraker/components/spoolman.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit a71c5c1

Please sign in to comment.