pypetkitapi 1.17.1__py3-none-any.whl → 1.18.0__py3-none-any.whl
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/__init__.py +1 -1
- pypetkitapi/const.py +1 -1
- pypetkitapi/litter_container.py +3 -3
- pypetkitapi/media.py +29 -0
- {pypetkitapi-1.17.1.dist-info → pypetkitapi-1.18.0.dist-info}/METADATA +1 -1
- {pypetkitapi-1.17.1.dist-info → pypetkitapi-1.18.0.dist-info}/RECORD +8 -8
- {pypetkitapi-1.17.1.dist-info → pypetkitapi-1.18.0.dist-info}/LICENSE +0 -0
- {pypetkitapi-1.17.1.dist-info → pypetkitapi-1.18.0.dist-info}/WHEEL +0 -0
pypetkitapi/__init__.py
CHANGED
pypetkitapi/const.py
CHANGED
pypetkitapi/litter_container.py
CHANGED
@@ -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
|
pypetkitapi/media.py
CHANGED
@@ -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
|
@@ -1,19 +1,19 @@
|
|
1
|
-
pypetkitapi/__init__.py,sha256
|
1
|
+
pypetkitapi/__init__.py,sha256=-K15jZnfHBmYyYERr0dH_NR7gvEB4GW2zxHdTJ1n45k,2107
|
2
2
|
pypetkitapi/bluetooth.py,sha256=VNoJ3E9WXzEfqRoWwKiemITKIt9aa9ICRzDvFuJ3PP0,9915
|
3
3
|
pypetkitapi/client.py,sha256=D49j-5oks0iJDgQbHKDyapZjhtfCNE7rrowl3yL_YSk,31299
|
4
4
|
pypetkitapi/command.py,sha256=zw4h1SCInG2T0-wAA_al59_FTL36TUZldtJkYKw6ATI,7655
|
5
|
-
pypetkitapi/const.py,sha256
|
5
|
+
pypetkitapi/const.py,sha256=gnJCsn4LVetsN6LwR2D5tqbxTITiwP4mNc1nSgAD8Qw,4997
|
6
6
|
pypetkitapi/containers.py,sha256=MWfSHLU-ZEIf220nv3-96U41PhCl9Gh6ETBV_SYBvV4,6648
|
7
7
|
pypetkitapi/exceptions.py,sha256=4BXUyYXLfZjNxdnOGJPjyE9ASIl7JmQphjws87jvHtE,1631
|
8
8
|
pypetkitapi/feeder_container.py,sha256=PhidWd5WpsZqtdKZy60PzE67YXgQfApjm8CqvMCHK3U,14743
|
9
|
-
pypetkitapi/litter_container.py,sha256=
|
10
|
-
pypetkitapi/media.py,sha256=
|
9
|
+
pypetkitapi/litter_container.py,sha256=17Qf23MgdSTgTVjLGAjpiMyClngBemyaHGQN4tDOiJE,20919
|
10
|
+
pypetkitapi/media.py,sha256=LyXvzE_n8lupFoLgnuFsRzSPoAx5dZz2zhVyxMUVlnE,30412
|
11
11
|
pypetkitapi/purifier_container.py,sha256=NlDZ2eAuD3xnqLGfFzaXErQXBPHjSbUI9tXln5K9mG4,3200
|
12
12
|
pypetkitapi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
13
13
|
pypetkitapi/schedule_container.py,sha256=ycIHeQHkVILDp7ZBjaVdGI_9rhHrgqeKBfvQAX3JMGE,2071
|
14
14
|
pypetkitapi/utils.py,sha256=z7325kcJQUburnF28HSXrJMvY_gY9007K73Zwxp-4DQ,743
|
15
15
|
pypetkitapi/water_fountain_container.py,sha256=5J0b-fDZYcFLNX2El7fifv8H6JMhBCt-ttxSow1ozRQ,6787
|
16
|
-
pypetkitapi-1.
|
17
|
-
pypetkitapi-1.
|
18
|
-
pypetkitapi-1.
|
19
|
-
pypetkitapi-1.
|
16
|
+
pypetkitapi-1.18.0.dist-info/LICENSE,sha256=u5jNkZEn6YMrtN4Kr5rU3TcBJ5-eAt0qMx4JDsbsnzM,1074
|
17
|
+
pypetkitapi-1.18.0.dist-info/METADATA,sha256=XDXTt_vXjY4uRaK4xNa_jNHGKeA9xv1RpAr-rMTp7fw,12977
|
18
|
+
pypetkitapi-1.18.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
19
|
+
pypetkitapi-1.18.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|