pypetkitapi 1.10.1__tar.gz → 1.10.2__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.10.1 → pypetkitapi-1.10.2}/PKG-INFO +1 -1
- {pypetkitapi-1.10.1 → pypetkitapi-1.10.2}/pypetkitapi/__init__.py +1 -1
- {pypetkitapi-1.10.1 → pypetkitapi-1.10.2}/pypetkitapi/litter_container.py +1 -1
- {pypetkitapi-1.10.1 → pypetkitapi-1.10.2}/pypetkitapi/media.py +9 -3
- {pypetkitapi-1.10.1 → pypetkitapi-1.10.2}/pyproject.toml +2 -2
- {pypetkitapi-1.10.1 → pypetkitapi-1.10.2}/LICENSE +0 -0
- {pypetkitapi-1.10.1 → pypetkitapi-1.10.2}/README.md +0 -0
- {pypetkitapi-1.10.1 → pypetkitapi-1.10.2}/pypetkitapi/bluetooth.py +0 -0
- {pypetkitapi-1.10.1 → pypetkitapi-1.10.2}/pypetkitapi/client.py +0 -0
- {pypetkitapi-1.10.1 → pypetkitapi-1.10.2}/pypetkitapi/command.py +0 -0
- {pypetkitapi-1.10.1 → pypetkitapi-1.10.2}/pypetkitapi/const.py +0 -0
- {pypetkitapi-1.10.1 → pypetkitapi-1.10.2}/pypetkitapi/containers.py +0 -0
- {pypetkitapi-1.10.1 → pypetkitapi-1.10.2}/pypetkitapi/exceptions.py +0 -0
- {pypetkitapi-1.10.1 → pypetkitapi-1.10.2}/pypetkitapi/feeder_container.py +0 -0
- {pypetkitapi-1.10.1 → pypetkitapi-1.10.2}/pypetkitapi/purifier_container.py +0 -0
- {pypetkitapi-1.10.1 → pypetkitapi-1.10.2}/pypetkitapi/py.typed +0 -0
- {pypetkitapi-1.10.1 → pypetkitapi-1.10.2}/pypetkitapi/schedule_container.py +0 -0
- {pypetkitapi-1.10.1 → pypetkitapi-1.10.2}/pypetkitapi/utils.py +0 -0
- {pypetkitapi-1.10.1 → pypetkitapi-1.10.2}/pypetkitapi/water_fountain_container.py +0 -0
@@ -451,7 +451,7 @@ class Litter(BaseModel):
|
|
451
451
|
service_status: int | None = Field(None, alias="serviceStatus")
|
452
452
|
total_time: int | None = Field(None, alias="totalTime")
|
453
453
|
with_k3: int | None = Field(None, alias="withK3")
|
454
|
-
|
454
|
+
user: UserDevice | None = None
|
455
455
|
device_records: list[LitterRecord] | None = None
|
456
456
|
device_stats: LitterStats | None = None
|
457
457
|
device_pet_graph_out: list[PetOutGraph] | None = None
|
@@ -102,7 +102,6 @@ class MediaManager:
|
|
102
102
|
self, storage_path: Path, device_id: int
|
103
103
|
) -> None:
|
104
104
|
"""Construct the media file table for disk storage."""
|
105
|
-
|
106
105
|
self.media_table.clear()
|
107
106
|
|
108
107
|
today_str = datetime.now().strftime("%Y%m%d")
|
@@ -114,7 +113,7 @@ class MediaManager:
|
|
114
113
|
video_path = record_path / "video"
|
115
114
|
|
116
115
|
# Regex pattern to match valid filenames
|
117
|
-
valid_pattern = re.compile(rf"^{device_id}_\d+\.(jpg|avi)$")
|
116
|
+
valid_pattern = re.compile(rf"^(?:\d+_)?{device_id}_\d+\.(jpg|avi)$")
|
118
117
|
|
119
118
|
# Populate the media table with event_id from filenames
|
120
119
|
for subdir in [snapshot_path, video_path]:
|
@@ -130,7 +129,7 @@ class MediaManager:
|
|
130
129
|
if entry.is_file() and valid_pattern.match(entry.name):
|
131
130
|
_LOGGER.debug("Entries found: %s", entry.name)
|
132
131
|
event_id = Path(entry.name).stem
|
133
|
-
timestamp =
|
132
|
+
timestamp = self._extraire_timestamp(str(entry.name))
|
134
133
|
media_type_str = Path(entry.name).suffix.lstrip(".")
|
135
134
|
try:
|
136
135
|
media_type = MediaType(media_type_str)
|
@@ -148,6 +147,13 @@ class MediaManager:
|
|
148
147
|
)
|
149
148
|
)
|
150
149
|
|
150
|
+
@staticmethod
|
151
|
+
def _extraire_timestamp(nom_fichier: str) -> int:
|
152
|
+
match = re.search(r"_(\d+)\.[a-zA-Z0-9]+$", nom_fichier)
|
153
|
+
if match:
|
154
|
+
return int(match.group(1))
|
155
|
+
return 0
|
156
|
+
|
151
157
|
async def prepare_missing_files(
|
152
158
|
self,
|
153
159
|
media_cloud_list: list[MediaCloud],
|
@@ -187,7 +187,7 @@ build-backend = "poetry.core.masonry.api"
|
|
187
187
|
|
188
188
|
[tool.poetry]
|
189
189
|
name = "pypetkitapi"
|
190
|
-
version = "1.10.
|
190
|
+
version = "1.10.2"
|
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.10.
|
212
|
+
current_version = "1.10.2"
|
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
|
File without changes
|