Temperature Ranges - Store extruder/bed temps as min/max #5

Closed
opened 2026-01-15 01:20:42 +00:00 by tonym · 0 comments
Owner

Problem

Currently extruder and bed temperatures are stored as single values. For labels and practical use, a range (e.g., 190-210°C) is more useful.

Solution

Convert single temp fields to min/max ranges.

Database Changes

Modify spoolman/database/models.py:

# Old:
settings_extruder_temp: Mapped[Optional[int]]
settings_bed_temp: Mapped[Optional[int]]

# New:
settings_extruder_temp_min: Mapped[Optional[int]]
settings_extruder_temp_max: Mapped[Optional[int]]
settings_bed_temp_min: Mapped[Optional[int]]
settings_bed_temp_max: Mapped[Optional[int]]

Migration

New migration to:

  • Add 4 new columns
  • Copy existing values to both min and max
  • Consider backwards compatibility

API Changes

  • Update Pydantic models
  • Accept legacy single value and map to both min/max

Frontend Changes

  • Replace single InputNumber with two fields or range slider
  • Update label template: ET: {filament.settings_extruder_temp_min}-{filament.settings_extruder_temp_max} °C

Priority

Medium - requires migration

## Problem Currently extruder and bed temperatures are stored as single values. For labels and practical use, a range (e.g., 190-210°C) is more useful. ## Solution Convert single temp fields to min/max ranges. ### Database Changes **Modify `spoolman/database/models.py`:** ```python # Old: settings_extruder_temp: Mapped[Optional[int]] settings_bed_temp: Mapped[Optional[int]] # New: settings_extruder_temp_min: Mapped[Optional[int]] settings_extruder_temp_max: Mapped[Optional[int]] settings_bed_temp_min: Mapped[Optional[int]] settings_bed_temp_max: Mapped[Optional[int]] ``` ### Migration New migration to: - Add 4 new columns - Copy existing values to both min and max - Consider backwards compatibility ### API Changes - Update Pydantic models - Accept legacy single value and map to both min/max ### Frontend Changes - Replace single InputNumber with two fields or range slider - Update label template: `ET: {filament.settings_extruder_temp_min}-{filament.settings_extruder_temp_max} °C` ## Priority Medium - requires migration
tonym closed this issue 2026-01-16 03:41:13 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: tonym/spoolman2#5
No description provided.