Skip to content

Commit 081fb64

Browse files
committed
fix(models): add missing creation_time initialization in Zone class
The Zone class declared creation_time as an attribute but never initialized it in __init__, causing AttributeError when accessed. Also fixes type annotations to match API reality (int timestamps) and aligns with the Place class pattern.
1 parent 9161fff commit 081fb64

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pyoverkiz/models.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -885,8 +885,8 @@ class ZoneItem:
885885
class Zone:
886886
"""A Zone groups related devices inside a place."""
887887

888-
creation_time: str
889-
last_update_time: str
888+
creation_time: int
889+
last_update_time: int | None = None
890890
label: str
891891
type: int
892892
items: list[ZoneItem] | None
@@ -897,7 +897,8 @@ class Zone:
897897
def __init__(
898898
self,
899899
*,
900-
last_update_time: str,
900+
creation_time: int,
901+
last_update_time: int | None = None,
901902
label: str,
902903
type: int,
903904
items: list[dict[str, Any]] | None,
@@ -907,6 +908,7 @@ def __init__(
907908
**_: Any,
908909
) -> None:
909910
"""Initialize Zone from API data and convert nested items."""
911+
self.creation_time = creation_time
910912
self.last_update_time = last_update_time
911913
self.label = label
912914
self.type = type

0 commit comments

Comments
 (0)