spoolman: filter spool_id before setting it active

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2023-10-24 19:32:24 -04:00
parent 17ffb4455e
commit a71c5c159d
No known key found for this signature in database
GPG Key ID: 5A1EB336DFB4C71B
1 changed files with 3 additions and 0 deletions

View File

@ -107,6 +107,9 @@ class SpoolManager:
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()