From f34a9b23a5e01a5f65857f7e189faaa225cf4180 Mon Sep 17 00:00:00 2001 From: Leggin Date: Fri, 16 Feb 2024 08:13:04 +0100 Subject: [PATCH] make optional values default to None --- src/dirigera/devices/outlet.py | 2 +- src/dirigera/devices/scene.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/dirigera/devices/outlet.py b/src/dirigera/devices/outlet.py index 1831f77..65277fa 100644 --- a/src/dirigera/devices/outlet.py +++ b/src/dirigera/devices/outlet.py @@ -11,7 +11,7 @@ class OutletAttributes(Attributes): is_on: bool - startup_on_off: Optional[StartupEnum] + startup_on_off: Optional[StartupEnum] = None class Outlet(Device): diff --git a/src/dirigera/devices/scene.py b/src/dirigera/devices/scene.py index f7fcd70..acf44c8 100644 --- a/src/dirigera/devices/scene.py +++ b/src/dirigera/devices/scene.py @@ -10,9 +10,9 @@ class SceneAttributes(Attributes): scene_id: str name: str icon: str - last_completed: Optional[str] - last_triggered: Optional[str] - last_undo: Optional[str] + last_completed: Optional[str] = None + last_triggered: Optional[str] = None + last_undo: Optional[str] = None class Info(BaseIkeaModel): @@ -45,9 +45,9 @@ class Scene(BaseIkeaModel): triggers: List[Trigger] actions: List[Action] created_at: datetime.datetime - last_completed: Optional[datetime.datetime] - last_triggered: Optional[datetime.datetime] - last_undo: Optional[datetime.datetime] + last_completed: Optional[datetime.datetime] = None + last_triggered: Optional[datetime.datetime] = None + last_undo: Optional[datetime.datetime] = None commands: List[str] undo_allowed_duration: int