From c5999e5251d68cfd340a62a641aaba83c93213bf Mon Sep 17 00:00:00 2001 From: Itelo Filho Date: Fri, 10 Nov 2023 12:49:48 -0300 Subject: [PATCH 1/5] add wait_for_code to offline access code --- seamapi/access_codes.py | 1 + seamapi/types.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/seamapi/access_codes.py b/seamapi/access_codes.py index eff38d5..2606360 100644 --- a/seamapi/access_codes.py +++ b/seamapi/access_codes.py @@ -244,6 +244,7 @@ def create( if ( wait_for_code + and not is_offline_access_code and starts_at is not None and datetime.fromisoformat(starts_at) > datetime.now() + timedelta(seconds=5) diff --git a/seamapi/types.py b/seamapi/types.py index 336048e..c78ee28 100644 --- a/seamapi/types.py +++ b/seamapi/types.py @@ -194,7 +194,7 @@ class AccessCode: access_code_id: str device_id: str type: str - code: str + code: Optional[str] = None created_at: str errors: List[Dict[str, Any]] warnings: List[Dict[str, Any]] From cf43032b9fbcea7426dd1f25e7bed9abdad3aabf Mon Sep 17 00:00:00 2001 From: Itelo Filho Date: Fri, 10 Nov 2023 14:23:32 -0300 Subject: [PATCH 2/5] change ordering of code & created_at --- seamapi/types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seamapi/types.py b/seamapi/types.py index c78ee28..a41e9af 100644 --- a/seamapi/types.py +++ b/seamapi/types.py @@ -194,8 +194,8 @@ class AccessCode: access_code_id: str device_id: str type: str - code: Optional[str] = None created_at: str + code: Optional[str] = None errors: List[Dict[str, Any]] warnings: List[Dict[str, Any]] starts_at: Optional[str] = None From efce92b603611b073c5ce30a55f8b5b2a16c7892 Mon Sep 17 00:00:00 2001 From: Itelo Filho Date: Fri, 10 Nov 2023 14:25:30 -0300 Subject: [PATCH 3/5] use empty string instead of none --- seamapi/types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seamapi/types.py b/seamapi/types.py index a41e9af..a7f1584 100644 --- a/seamapi/types.py +++ b/seamapi/types.py @@ -194,8 +194,8 @@ class AccessCode: access_code_id: str device_id: str type: str + code: Optional[str] = "" created_at: str - code: Optional[str] = None errors: List[Dict[str, Any]] warnings: List[Dict[str, Any]] starts_at: Optional[str] = None From bbb4b27519d140f162c604e96f8134ec3123e1ae Mon Sep 17 00:00:00 2001 From: Itelo Filho Date: Fri, 10 Nov 2023 15:12:02 -0300 Subject: [PATCH 4/5] created_at = None to fix type issues --- seamapi/types.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seamapi/types.py b/seamapi/types.py index a7f1584..1a39601 100644 --- a/seamapi/types.py +++ b/seamapi/types.py @@ -194,8 +194,8 @@ class AccessCode: access_code_id: str device_id: str type: str - code: Optional[str] = "" - created_at: str + code: Optional[str] = None + created_at: str = None errors: List[Dict[str, Any]] warnings: List[Dict[str, Any]] starts_at: Optional[str] = None From 38842c4aff69c22f9c47a8623aab235779383b9c Mon Sep 17 00:00:00 2001 From: Itelo Filho Date: Fri, 10 Nov 2023 15:26:32 -0300 Subject: [PATCH 5/5] fix follows default argument --- seamapi/types.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seamapi/types.py b/seamapi/types.py index 1a39601..dd692e8 100644 --- a/seamapi/types.py +++ b/seamapi/types.py @@ -194,10 +194,10 @@ class AccessCode: access_code_id: str device_id: str type: str - code: Optional[str] = None - created_at: str = None + created_at: str errors: List[Dict[str, Any]] warnings: List[Dict[str, Any]] + code: Optional[str] = None starts_at: Optional[str] = None ends_at: Optional[str] = None name: Optional[str] = ""