Convert Door.width_mm to store actual millimetres (multiply size.x by 1000)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Daniel Roth 2026-06-05 13:30:54 +00:00
parent bffac89abb
commit b3b4ae2191
4 changed files with 5 additions and 5 deletions

View file

@ -129,6 +129,6 @@ def test_door_has_width_mm_and_type() -> None:
def test_door_instantiation() -> None:
door = MagicPlanDoorModel(magic_plan_room_id=1, width_mm=0.79, type="hinged")
assert door.width_mm == 0.79
door = MagicPlanDoorModel(magic_plan_room_id=1, width_mm=790.0, type="hinged")
assert door.width_mm == 790.0
assert door.type == "hinged"

View file

@ -109,7 +109,7 @@ def _map_window_ventilation(
def _map_door(wi: api.WallItem) -> Door:
return Door(
width_mm=round(wi.size.x, 2),
width_mm=round(wi.size.x * 1000, 0),
ventilation=_map_door_ventilation(wi.custom_displayable_fields),
)

View file

@ -27,7 +27,7 @@ class Window:
@dataclass
class Door:
width_mm: float # TODO: should this be m or mm?
width_mm: float
ventilation: Optional[DoorVentilation] = None

View file

@ -137,7 +137,7 @@ def test_door_width_is_float(plan: Plan) -> None:
def test_door_width_rounded_to_2dp(plan: Plan) -> None:
door = plan.floors[0].rooms[0].doors[0]
assert door.width_mm == 0.80
assert door.width_mm == 800.0
# --- Ventilation ---