pypetkitapi 1.17.1__tar.gz → 1.18.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pypetkitapi
3
- Version: 1.17.1
3
+ Version: 1.18.0
4
4
  Summary: Python client for PetKit API
5
5
  License: MIT
6
6
  Author: Jezza34000
@@ -51,7 +51,7 @@ from .media import DownloadDecryptMedia, MediaCloud, MediaFile, MediaManager
51
51
  from .purifier_container import Purifier
52
52
  from .water_fountain_container import WaterFountain
53
53
 
54
- __version__ = "1.17.1"
54
+ __version__ = "1.18.0"
55
55
 
56
56
  __all__ = [
57
57
  "CTW3",
@@ -126,7 +126,7 @@ class RecordType(StrEnum):
126
126
  MOVE = "move"
127
127
  PET = "pet"
128
128
  TOILETING = "toileting"
129
- WASTE = "waste"
129
+ WASTE = "waste_check"
130
130
  DISH_BEFORE = "dish_before"
131
131
  DISH_AFTER = "dish_after"
132
132
 
@@ -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.name.lower()}"
471
+ media_files.append(
472
+ MediaCloud(
473
+ event_id=record.event_id,
474
+ event_type=RecordType.WASTE,
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.17.1"
190
+ version = "1.18.0"
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.17.1"
212
+ current_version = "1.18.0"
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