pypetkitapi 1.17.1__tar.gz → 1.18.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pypetkitapi-1.17.1 → pypetkitapi-1.18.1}/PKG-INFO +1 -1
- {pypetkitapi-1.17.1 → pypetkitapi-1.18.1}/pypetkitapi/__init__.py +1 -1
- {pypetkitapi-1.17.1 → pypetkitapi-1.18.1}/pypetkitapi/const.py +2 -2
- {pypetkitapi-1.17.1 → pypetkitapi-1.18.1}/pypetkitapi/litter_container.py +3 -3
- {pypetkitapi-1.17.1 → pypetkitapi-1.18.1}/pypetkitapi/media.py +29 -0
- {pypetkitapi-1.17.1 → pypetkitapi-1.18.1}/pyproject.toml +2 -2
- {pypetkitapi-1.17.1 → pypetkitapi-1.18.1}/LICENSE +0 -0
- {pypetkitapi-1.17.1 → pypetkitapi-1.18.1}/README.md +0 -0
- {pypetkitapi-1.17.1 → pypetkitapi-1.18.1}/pypetkitapi/bluetooth.py +0 -0
- {pypetkitapi-1.17.1 → pypetkitapi-1.18.1}/pypetkitapi/client.py +0 -0
- {pypetkitapi-1.17.1 → pypetkitapi-1.18.1}/pypetkitapi/command.py +0 -0
- {pypetkitapi-1.17.1 → pypetkitapi-1.18.1}/pypetkitapi/containers.py +0 -0
- {pypetkitapi-1.17.1 → pypetkitapi-1.18.1}/pypetkitapi/exceptions.py +0 -0
- {pypetkitapi-1.17.1 → pypetkitapi-1.18.1}/pypetkitapi/feeder_container.py +0 -0
- {pypetkitapi-1.17.1 → pypetkitapi-1.18.1}/pypetkitapi/purifier_container.py +0 -0
- {pypetkitapi-1.17.1 → pypetkitapi-1.18.1}/pypetkitapi/py.typed +0 -0
- {pypetkitapi-1.17.1 → pypetkitapi-1.18.1}/pypetkitapi/schedule_container.py +0 -0
- {pypetkitapi-1.17.1 → pypetkitapi-1.18.1}/pypetkitapi/utils.py +0 -0
- {pypetkitapi-1.17.1 → pypetkitapi-1.18.1}/pypetkitapi/water_fountain_container.py +0 -0
@@ -126,7 +126,7 @@ class RecordType(StrEnum):
|
|
126
126
|
MOVE = "move"
|
127
127
|
PET = "pet"
|
128
128
|
TOILETING = "toileting"
|
129
|
-
|
129
|
+
WASTE_CHECK = "waste_check"
|
130
130
|
DISH_BEFORE = "dish_before"
|
131
131
|
DISH_AFTER = "dish_after"
|
132
132
|
|
@@ -137,7 +137,7 @@ RecordTypeLST = [
|
|
137
137
|
RecordType.MOVE,
|
138
138
|
RecordType.PET,
|
139
139
|
RecordType.TOILETING,
|
140
|
-
RecordType.
|
140
|
+
RecordType.WASTE_CHECK,
|
141
141
|
RecordType.DISH_BEFORE,
|
142
142
|
RecordType.DISH_AFTER,
|
143
143
|
]
|
@@ -226,7 +226,7 @@ class ShitPictures(BaseModel):
|
|
226
226
|
LitterRecord -> ShitPictures
|
227
227
|
"""
|
228
228
|
|
229
|
-
created_at: str | None = Field(None, alias="createdAt")
|
229
|
+
created_at: str | int | None = Field(None, alias="createdAt")
|
230
230
|
pic_id: str | None = Field(None, alias="picId")
|
231
231
|
shit_aes_key: str | None = Field(None, alias="shitAesKey")
|
232
232
|
shit_picture: str | None = Field(None, alias="shitPicture")
|
@@ -251,7 +251,7 @@ class LRSubContent(BaseModel):
|
|
251
251
|
preview: str | None = None
|
252
252
|
related_event: str | None = Field(None, alias="relatedEvent")
|
253
253
|
shit_aes_key: str | None = Field(None, alias="shitAesKey")
|
254
|
-
shit_pictures: ShitPictures | None = None
|
254
|
+
shit_pictures: list[ShitPictures] | None = Field(None, alias="shitPictures")
|
255
255
|
storage_space: int | None = Field(None, alias="storageSpace")
|
256
256
|
sub_content: list[Any] | None = Field(None, alias="subContent")
|
257
257
|
timestamp: int | None = None
|
@@ -283,7 +283,7 @@ class LitterRecord(BaseModel):
|
|
283
283
|
pet_name: str | None = Field(None, alias="petName")
|
284
284
|
preview: str | None = None
|
285
285
|
related_event: str | None = Field(None, alias="relatedEvent")
|
286
|
-
shit_pictures: ShitPictures | None = None
|
286
|
+
shit_pictures: list[ShitPictures] | None = Field(None, alias="shitPictures")
|
287
287
|
storage_space: int | None = Field(None, alias="storageSpace")
|
288
288
|
sub_content: list[LRSubContent] | None = Field(None, alias="subContent")
|
289
289
|
timestamp: int | None = None
|
@@ -453,6 +453,35 @@ class MediaManager:
|
|
453
453
|
timestamp=record.timestamp,
|
454
454
|
)
|
455
455
|
)
|
456
|
+
|
457
|
+
# Gather Waste images if available
|
458
|
+
if hasattr(record, "sub_content") and record.sub_content:
|
459
|
+
for sub_record in record.sub_content:
|
460
|
+
if (
|
461
|
+
hasattr(sub_record, "shit_pictures")
|
462
|
+
and isinstance(sub_record.shit_pictures, list)
|
463
|
+
and len(sub_record.shit_pictures) > 2
|
464
|
+
):
|
465
|
+
waste_image_data = sub_record.shit_pictures[2]
|
466
|
+
if (
|
467
|
+
waste_image_data.shit_picture
|
468
|
+
and waste_image_data.shit_aes_key
|
469
|
+
):
|
470
|
+
waste_filepath = f"{litter_id}/{date_str}/{RecordType.WASTE_CHECK.name.lower()}"
|
471
|
+
media_files.append(
|
472
|
+
MediaCloud(
|
473
|
+
event_id=record.event_id,
|
474
|
+
event_type=RecordType.WASTE_CHECK,
|
475
|
+
device_id=litter_id,
|
476
|
+
user_id=user_id,
|
477
|
+
image=waste_image_data.shit_picture,
|
478
|
+
video=None,
|
479
|
+
filepath=waste_filepath,
|
480
|
+
aes_key=waste_image_data.shit_aes_key,
|
481
|
+
timestamp=record.timestamp,
|
482
|
+
)
|
483
|
+
)
|
484
|
+
|
456
485
|
return media_files
|
457
486
|
|
458
487
|
@staticmethod
|
@@ -187,7 +187,7 @@ build-backend = "poetry.core.masonry.api"
|
|
187
187
|
|
188
188
|
[tool.poetry]
|
189
189
|
name = "pypetkitapi"
|
190
|
-
version = "1.
|
190
|
+
version = "1.18.1"
|
191
191
|
description = "Python client for PetKit API"
|
192
192
|
authors = ["Jezza34000 <info@mail.com>"]
|
193
193
|
readme = "README.md"
|
@@ -209,7 +209,7 @@ ruff = "^0.8.1"
|
|
209
209
|
types-aiofiles = "^24.1.0.20240626"
|
210
210
|
|
211
211
|
[tool.bumpver]
|
212
|
-
current_version = "1.
|
212
|
+
current_version = "1.18.1"
|
213
213
|
version_pattern = "MAJOR.MINOR.PATCH"
|
214
214
|
commit_message = "bump version {old_version} -> {new_version}"
|
215
215
|
tag_message = "{new_version}"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|