mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
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:
parent
bffac89abb
commit
b3b4ae2191
4 changed files with 5 additions and 5 deletions
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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 ---
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue