pypetkitapi 1.7.0__py3-none-any.whl → 1.7.1__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/containers.py +2 -2
- {pypetkitapi-1.7.0.dist-info → pypetkitapi-1.7.1.dist-info}/METADATA +8 -6
- {pypetkitapi-1.7.0.dist-info → pypetkitapi-1.7.1.dist-info}/RECORD +5 -5
- {pypetkitapi-1.7.0.dist-info → pypetkitapi-1.7.1.dist-info}/LICENSE +0 -0
- {pypetkitapi-1.7.0.dist-info → pypetkitapi-1.7.1.dist-info}/WHEEL +0 -0
pypetkitapi/containers.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
"""Dataclasses container for petkit API."""
|
2
2
|
|
3
|
-
from pydantic import BaseModel, Field,
|
3
|
+
from pydantic import BaseModel, Field, root_validator
|
4
4
|
|
5
5
|
|
6
6
|
class RegionInfo(BaseModel):
|
@@ -81,7 +81,7 @@ class Pet(BaseModel):
|
|
81
81
|
last_duration_usage: int = 0
|
82
82
|
last_measured_weight: int = 0
|
83
83
|
|
84
|
-
@
|
84
|
+
@root_validator(pre=True)
|
85
85
|
def populate_fictive_fields(cls, values): # noqa: N805
|
86
86
|
"""Populate fictive fields based on other fields."""
|
87
87
|
values["id"] = values.get("id") or values.get("petId")
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: pypetkitapi
|
3
|
-
Version: 1.7.
|
3
|
+
Version: 1.7.1
|
4
4
|
Summary: Python client for PetKit API
|
5
5
|
Home-page: https://github.com/Jezza34000/pypetkit
|
6
6
|
License: MIT
|
@@ -14,7 +14,7 @@ Classifier: Programming Language :: Python :: 3.12
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.13
|
15
15
|
Requires-Dist: aiohttp (>=3.11.11,<4.0.0)
|
16
16
|
Requires-Dist: pycryptodome (>=3.19.1,<4.0.0)
|
17
|
-
Requires-Dist: pydantic (
|
17
|
+
Requires-Dist: pydantic (>=1.10.19,<2.0.0)
|
18
18
|
Description-Content-Type: text/markdown
|
19
19
|
|
20
20
|
# Petkit API Client
|
@@ -83,11 +83,13 @@ async def main():
|
|
83
83
|
|
84
84
|
await client.get_devices_data()
|
85
85
|
|
86
|
-
#
|
87
|
-
print(client.account_data)
|
86
|
+
# Lists all devices and pet from account
|
88
87
|
|
89
|
-
|
90
|
-
|
88
|
+
for key, value in client.petkit_entities.items():
|
89
|
+
print(f"{key}: {type(value).__name__} - {value.name}")
|
90
|
+
|
91
|
+
# Read devices or pet information
|
92
|
+
print(client.petkit_entities[123456789])
|
91
93
|
|
92
94
|
# Send command to the devices
|
93
95
|
### Example 1 : Turn on the indicator light
|
@@ -2,14 +2,14 @@ pypetkitapi/__init__.py,sha256=eVpyGMD3tkYtiHUkdKEeNSZhQlZ4woI2Y5oVoV7CwXM,61
|
|
2
2
|
pypetkitapi/client.py,sha256=cE_kfxYMZ_aPmqapvffLUSjScvfOZh_Q2OTZb7YiVcs,19621
|
3
3
|
pypetkitapi/command.py,sha256=gw3_J_oZHuuGLk66P8uRSqSrySjYa8ArpKaPHi2ybCw,7155
|
4
4
|
pypetkitapi/const.py,sha256=9XNLhM9k0GwNmWPgGef5roULpsYVZ7hzxptGgNhjs74,3432
|
5
|
-
pypetkitapi/containers.py,sha256=
|
5
|
+
pypetkitapi/containers.py,sha256=8HA2LEzHga062LcC08c9JCowyDRmjjf8en4ImZ6tg_4,4352
|
6
6
|
pypetkitapi/exceptions.py,sha256=NWmpsI2ewC4HaIeu_uFwCeuPIHIJxZBzjoCP7aNwvhs,1139
|
7
7
|
pypetkitapi/feeder_container.py,sha256=28GXZ8Nbs08PnFZZI4ENBe3UJ63gsXT3rFa151KrPxo,13310
|
8
8
|
pypetkitapi/litter_container.py,sha256=fTPHa5VQvM6Ycm-XIeu3N1E6dTI4g1zEqC-o23sxdhE,18068
|
9
9
|
pypetkitapi/medias.py,sha256=1Nso1YZK_Bz4MrSuQ_zjawoyg5KqO_JoBSQaMmvh6Jo,7216
|
10
10
|
pypetkitapi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
11
11
|
pypetkitapi/water_fountain_container.py,sha256=j6FQEgbZAbsPXDVhcIB05RsNnQJftcWUJKmzuX4TrjM,6712
|
12
|
-
pypetkitapi-1.7.
|
13
|
-
pypetkitapi-1.7.
|
14
|
-
pypetkitapi-1.7.
|
15
|
-
pypetkitapi-1.7.
|
12
|
+
pypetkitapi-1.7.1.dist-info/LICENSE,sha256=4FWnKolNLc1e3w6cVlT61YxfPh0DQNeQLN1CepKKSBg,1067
|
13
|
+
pypetkitapi-1.7.1.dist-info/METADATA,sha256=hg8UCPMYS0HB88FHcy6ZgsFDD7x-_uEqb7mzXmKt3jw,4809
|
14
|
+
pypetkitapi-1.7.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
15
|
+
pypetkitapi-1.7.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|