mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
Extract door height from API response into height_mm 🟩
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
db3477d6bb
commit
050f983152
2 changed files with 3 additions and 2 deletions
|
|
@ -110,7 +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,
|
||||
height_mm=round(wi.size.z * 1000, 0),
|
||||
ventilation=_map_door_ventilation(wi.custom_displayable_fields),
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -96,11 +96,12 @@ class MagicPlanDoorModel(SQLModel, table=True):
|
|||
id: Optional[int] = Field(default=None, primary_key=True)
|
||||
magic_plan_room_id: int = Field(foreign_key="magic_plan_room.id")
|
||||
width_mm: Optional[float] = None
|
||||
height_mm: Optional[float] = None
|
||||
type: Optional[str] = None
|
||||
|
||||
@classmethod
|
||||
def from_domain(cls, door: Door, room_id: int) -> "MagicPlanDoorModel":
|
||||
return cls(magic_plan_room_id=room_id, width_mm=door.width_mm)
|
||||
return cls(magic_plan_room_id=room_id, width_mm=door.width_mm, height_mm=door.height_mm)
|
||||
|
||||
|
||||
class MagicPlanWindowVentilationModel(SQLModel, table=True):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue