Extract door height from API response into height_mm 🟥

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

View file

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

View file

@ -28,6 +28,7 @@ class Window:
@dataclass
class Door:
width_mm: float
height_mm: float
ventilation: Optional[DoorVentilation] = None

View file

@ -140,6 +140,12 @@ def test_door_width_rounded_to_2dp(plan: Plan) -> None:
assert door.width_mm == 800.0
def test_door_height_is_correct(plan: Plan) -> None:
# Kitchen doorhinged has size.z = 2.04 m = 2040 mm
door = plan.floors[0].rooms[0].doors[0]
assert door.height_mm == 2040.0
# --- Ventilation ---

View file

@ -40,7 +40,7 @@ def _plan() -> Plan:
num_trickle_vents=2,
),
)
door = Door(width_mm=762.0, ventilation=DoorVentilation(undercut_mm=70.0))
door = Door(width_mm=762.0, height_mm=2040.0, ventilation=DoorVentilation(undercut_mm=70.0))
room = Room(
name="Living Room",
width_m=4.0,