rankjie-pypetkitapi 1.3.0.dev1__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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 - 2025 Jezza34000
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,209 @@
1
+ Metadata-Version: 2.4
2
+ Name: rankjie-pypetkitapi
3
+ Version: 1.3.0.dev1
4
+ Summary: Python client for PetKit API
5
+ License: MIT
6
+ License-File: LICENSE
7
+ Keywords: petkit,api,client,pet,iot
8
+ Author: Jezza34000
9
+ Author-email: info@mail.com
10
+ Requires-Python: >=3.11
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Programming Language :: Python :: 3.14
19
+ Classifier: Topic :: Home Automation
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Requires-Dist: aiofiles (>=24.1.0,<25.0.0)
22
+ Requires-Dist: aiohttp (>=3.11.11,<4.0.0)
23
+ Requires-Dist: m3u8 (>=6.0.0,<7.0.0)
24
+ Requires-Dist: pycryptodome (>=3.19.1,<4.0.0)
25
+ Requires-Dist: pydantic (>=2.10.4,<3.0.0)
26
+ Requires-Dist: tenacity (>=9.1.2,<10.0.0)
27
+ Project-URL: Homepage, https://github.com/rankjie/py-petkit-api
28
+ Project-URL: Repository, https://github.com/rankjie/py-petkit-api
29
+ Description-Content-Type: text/markdown
30
+
31
+ # Petkit API Client
32
+
33
+ ---
34
+
35
+ [![Lifecycle:Maturing](https://img.shields.io/badge/Lifecycle-Stable-007EC6)](https://github.com/Jezza34000/py-petkit-api/)
36
+ [![Python Version](https://img.shields.io/pypi/pyversions/pypetkitapi)][python version] [![Actions status](https://github.com/Jezza34000/py-petkit-api/workflows/CI/badge.svg)](https://github.com/Jezza34000/py-petkit-api/actions)
37
+
38
+ [![PyPI](https://img.shields.io/pypi/v/pypetkitapi.svg)][pypi_] [![PyPI Downloads](https://static.pepy.tech/badge/pypetkitapi)](https://pepy.tech/projects/pypetkitapi)
39
+
40
+ ---
41
+
42
+ [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Jezza34000_py-petkit-api&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=Jezza34000_py-petkit-api) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=Jezza34000_py-petkit-api&metric=coverage)](https://sonarcloud.io/summary/new_code?id=Jezza34000_py-petkit-api) [![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=Jezza34000_py-petkit-api&metric=ncloc)](https://sonarcloud.io/summary/new_code?id=Jezza34000_py-petkit-api)
43
+
44
+ [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=Jezza34000_py-petkit-api&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=Jezza34000_py-petkit-api)
45
+ [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=Jezza34000_py-petkit-api&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=Jezza34000_py-petkit-api)
46
+ [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=Jezza34000_py-petkit-api&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=Jezza34000_py-petkit-api)
47
+ [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=Jezza34000_py-petkit-api&metric=bugs)](https://sonarcloud.io/summary/new_code?id=Jezza34000_py-petkit-api)
48
+ [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=Jezza34000_py-petkit-api&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=Jezza34000_py-petkit-api)
49
+ [![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=Jezza34000_py-petkit-api&metric=duplicated_lines_density)](https://sonarcloud.io/summary/new_code?id=Jezza34000_py-petkit-api)
50
+ [![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=Jezza34000_py-petkit-api&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=Jezza34000_py-petkit-api)
51
+
52
+ [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)][pre-commit]
53
+ [![Black](https://img.shields.io/badge/code%20style-black-000000.svg)][black]
54
+ [![mypy](https://img.shields.io/badge/mypy-checked-blue)](https://mypy.readthedocs.io/en/stable/)
55
+ [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
56
+
57
+ ---
58
+
59
+ [pypi_]: https://pypi.org/project/pypetkitapi/
60
+ [python version]: https://pypi.org/project/pypetkitapi
61
+ [pre-commit]: https://github.com/pre-commit/pre-commit
62
+ [black]: https://github.com/psf/black
63
+
64
+ ### Enjoying this library?
65
+
66
+ [![Sponsor Jezza34000][github-sponsor-shield]][github-sponsor] [![Static Badge][buymeacoffee-shield]][buymeacoffee]
67
+
68
+ ---
69
+
70
+ ## â„šī¸ Overview
71
+
72
+ PetKit Client is a Python library for interacting with the PetKit API. It allows you to manage your PetKit devices, retrieve account data, and control devices through the API.
73
+
74
+ ## 🚀 Features
75
+
76
+ - Login and session management
77
+ - Fetch account and device data
78
+ - Control PetKit devices (Feeder, Litter Box, Water Fountain, Purifiers)
79
+ - Fetch images & videos produced by devices
80
+ > Pictures are available **with or without** Care+ subscription, Videos are only available **with** Care+ subscription
81
+
82
+ ## âŦ‡ī¸ Installation
83
+
84
+ Install the library using pip:
85
+
86
+ ```bash
87
+ pip install rankjie-pypetkitapi
88
+ ```
89
+
90
+ ## 💡 Usage Example:
91
+
92
+ Here is a simple example of how to use the library to interact with the PetKit API \
93
+ This example is not an exhaustive list of all the features available in the library.
94
+
95
+ ```python
96
+ import asyncio
97
+ import logging
98
+ import aiohttp
99
+ from pypetkitapi.client import PetKitClient
100
+ from pypetkitapi.command import DeviceCommand, FeederCommand, LBCommand, DeviceAction, LitterCommand
101
+
102
+ logging.basicConfig(level=logging.DEBUG)
103
+
104
+ async def main():
105
+ async with aiohttp.ClientSession() as session:
106
+ client = PetKitClient(
107
+ username="username", # Your PetKit account username or id
108
+ password="password", # Your PetKit account password
109
+ region="FR", # Your region or country code (e.g. FR, US,CN etc.)
110
+ timezone="Europe/Paris", # Your timezone(e.g. "Asia/Shanghai")
111
+ session=session,
112
+ )
113
+
114
+ await client.get_devices_data()
115
+
116
+ # Lists all devices and pet from account
117
+
118
+ for key, value in client.petkit_entities.items():
119
+ print(f"{key}: {type(value).__name__} - {value.name}")
120
+
121
+ # Select a device
122
+ device_id = key
123
+ # Read devices or pet information
124
+ print(client.petkit_entities[device_id])
125
+
126
+ # Send command to the devices
127
+ ### Example 1 : Turn on the indicator light
128
+ ### Device_ID, Command, Payload
129
+ await client.send_api_request(device_id, DeviceCommand.UPDATE_SETTING, {"lightMode": 1})
130
+
131
+ ### Example 2 : Feed the pet
132
+ ### Device_ID, Command, Payload
133
+ # simple hopper :
134
+ await client.send_api_request(device_id, FeederCommand.MANUAL_FEED, {"amount": 1})
135
+ # dual hopper :
136
+ await client.send_api_request(device_id, FeederCommand.MANUAL_FEED, {"amount1": 2})
137
+ # or
138
+ await client.send_api_request(device_id, FeederCommand.MANUAL_FEED, {"amount2": 2})
139
+
140
+ ### Example 3 : Start the cleaning process
141
+ ### Device_ID, Command, Payload
142
+ await client.send_api_request(device_id, LitterCommand.CONTROL_DEVICE, {DeviceAction.START: LBCommand.CLEANING})
143
+
144
+
145
+ if __name__ == "__main__":
146
+ asyncio.run(main())
147
+ ```
148
+
149
+ ## 💡 More example usage
150
+
151
+ Check at the usage in the Home Assistant integration : [here](https://github.com/Jezza34000/homeassistant_petkit)
152
+
153
+ ## â˜‘ī¸ Supported Devices
154
+
155
+ | **Category** | **Name** | **Device** |
156
+ | ---------------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
157
+ | **🍗 Feeders** | ✅ Fresh Element | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/feeder.png" width="40"/></a> |
158
+ | | ✅ Fresh Element Mini Pro | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/feedermini.png" width="40"/></a> |
159
+ | | ✅ Fresh Element Infinity | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/d3.png" width="40"/></a> |
160
+ | | ✅ Fresh Element Solo | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/d4.png" width="40"/></a> |
161
+ | | ✅ Fresh Element Gemini | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/d4s.png" width="40"/></a> |
162
+ | | ✅ YumShare Solo | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/d4h.png" width="40"/></a> |
163
+ | | ✅ YumShare Dual-hopper | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/d4sh.png" width="40"/></a> |
164
+ | **đŸšŊ Litters** | ✅ PuraX | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/t3.png" width="40"/></a> |
165
+ | | ✅ PuraMax | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/t4.1.png" width="40"/></a> |
166
+ | | ✅ PuraMax 2 | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/t4.png" width="40"/></a> |
167
+ | | ✅ Purobot Max Pro | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/t5.png" width="40"/></a> |
168
+ | | ✅ Purobot Ultra | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/t6.png" width="40"/></a> |
169
+ | **⛲ Fountains** | ✅ Eversweet Solo 2 | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/5w5.png" width="40"/></a> |
170
+ | | ✅ Eversweet 3 Pro | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/4w5.png" width="40"/></a> |
171
+ | | ✅ Eversweet 3 Pro UVC | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/6w5.png" width="40"/></a> |
172
+ | | ✅ Eversweet 5 Mini | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/2w5.png" width="40"/></a> |
173
+ | | ✅ Eversweet Max | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/ctw3.png" width="40"/></a> |
174
+ | **🧴 Purifiers** | ✅ Air Magicube | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/k2.png" width="40"/></a> |
175
+ | | ✅ Air Smart Spray | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/k3.png" width="40"/></a> |
176
+
177
+ ## 🛟 Help and Support
178
+
179
+ Developers? Want to help? Join us on our Discord channel dedicated to developers and contributors.
180
+
181
+ [![Discord][discord-shield]][discord]
182
+
183
+ ## 👨‍đŸ’ģ Contributing
184
+
185
+ Contributions are welcome!\
186
+ Please open an issue or submit a pull request.
187
+
188
+ ## License
189
+
190
+ This project is licensed under the MIT License. See the LICENSE file for details.
191
+
192
+ ---
193
+
194
+ [homeassistant_petkit]: https://github.com/Jezza34000/py-petkit-api
195
+ [commits-shield]: https://img.shields.io/github/commit-activity/y/Jezza34000/py-petkit-api.svg?style=flat
196
+ [commits]: https://github.com/Jezza34000/py-petkit-api/commits/main
197
+ [discord]: https://discord.gg/Va8DrmtweP
198
+ [discord-shield]: https://img.shields.io/discord/1318098700379361362.svg?style=for-the-badge&label=Discord&logo=discord&color=5865F2
199
+ [forum-shield]: https://img.shields.io/badge/community-forum-brightgreen.svg?style=for-the-badge&label=Home%20Assistant%20Community&logo=homeassistant&color=18bcf2
200
+ [forum]: https://community.home-assistant.io/t/petkit-integration/834431
201
+ [license-shield]: https://img.shields.io/github/license/Jezza34000/py-petkit-api.svg??style=flat
202
+ [maintenance-shield]: https://img.shields.io/badge/maintainer-Jezza34000-blue.svg?style=flat
203
+ [releases-shield]: https://img.shields.io/github/release/Jezza34000/py-petkit-api.svg?style=for-the-badge&color=41BDF5
204
+ [releases]: https://github.com/Jezza34000/py-petkit-api/releases
205
+ [github-sponsor-shield]: https://img.shields.io/badge/sponsor-Jezza34000-blue.svg?style=for-the-badge&logo=githubsponsors&color=EA4AAA
206
+ [github-sponsor]: https://github.com/sponsors/Jezza34000
207
+ [buymeacoffee-shield]: https://img.shields.io/badge/Donate-buy_me_a_coffee-yellow.svg?style=for-the-badge&logo=buy-me-a-coffee
208
+ [buymeacoffee]: https://www.buymeacoffee.com/jezza
209
+
@@ -0,0 +1,178 @@
1
+ # Petkit API Client
2
+
3
+ ---
4
+
5
+ [![Lifecycle:Maturing](https://img.shields.io/badge/Lifecycle-Stable-007EC6)](https://github.com/Jezza34000/py-petkit-api/)
6
+ [![Python Version](https://img.shields.io/pypi/pyversions/pypetkitapi)][python version] [![Actions status](https://github.com/Jezza34000/py-petkit-api/workflows/CI/badge.svg)](https://github.com/Jezza34000/py-petkit-api/actions)
7
+
8
+ [![PyPI](https://img.shields.io/pypi/v/pypetkitapi.svg)][pypi_] [![PyPI Downloads](https://static.pepy.tech/badge/pypetkitapi)](https://pepy.tech/projects/pypetkitapi)
9
+
10
+ ---
11
+
12
+ [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Jezza34000_py-petkit-api&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=Jezza34000_py-petkit-api) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=Jezza34000_py-petkit-api&metric=coverage)](https://sonarcloud.io/summary/new_code?id=Jezza34000_py-petkit-api) [![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=Jezza34000_py-petkit-api&metric=ncloc)](https://sonarcloud.io/summary/new_code?id=Jezza34000_py-petkit-api)
13
+
14
+ [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=Jezza34000_py-petkit-api&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=Jezza34000_py-petkit-api)
15
+ [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=Jezza34000_py-petkit-api&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=Jezza34000_py-petkit-api)
16
+ [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=Jezza34000_py-petkit-api&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=Jezza34000_py-petkit-api)
17
+ [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=Jezza34000_py-petkit-api&metric=bugs)](https://sonarcloud.io/summary/new_code?id=Jezza34000_py-petkit-api)
18
+ [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=Jezza34000_py-petkit-api&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=Jezza34000_py-petkit-api)
19
+ [![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=Jezza34000_py-petkit-api&metric=duplicated_lines_density)](https://sonarcloud.io/summary/new_code?id=Jezza34000_py-petkit-api)
20
+ [![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=Jezza34000_py-petkit-api&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=Jezza34000_py-petkit-api)
21
+
22
+ [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)][pre-commit]
23
+ [![Black](https://img.shields.io/badge/code%20style-black-000000.svg)][black]
24
+ [![mypy](https://img.shields.io/badge/mypy-checked-blue)](https://mypy.readthedocs.io/en/stable/)
25
+ [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
26
+
27
+ ---
28
+
29
+ [pypi_]: https://pypi.org/project/pypetkitapi/
30
+ [python version]: https://pypi.org/project/pypetkitapi
31
+ [pre-commit]: https://github.com/pre-commit/pre-commit
32
+ [black]: https://github.com/psf/black
33
+
34
+ ### Enjoying this library?
35
+
36
+ [![Sponsor Jezza34000][github-sponsor-shield]][github-sponsor] [![Static Badge][buymeacoffee-shield]][buymeacoffee]
37
+
38
+ ---
39
+
40
+ ## â„šī¸ Overview
41
+
42
+ PetKit Client is a Python library for interacting with the PetKit API. It allows you to manage your PetKit devices, retrieve account data, and control devices through the API.
43
+
44
+ ## 🚀 Features
45
+
46
+ - Login and session management
47
+ - Fetch account and device data
48
+ - Control PetKit devices (Feeder, Litter Box, Water Fountain, Purifiers)
49
+ - Fetch images & videos produced by devices
50
+ > Pictures are available **with or without** Care+ subscription, Videos are only available **with** Care+ subscription
51
+
52
+ ## âŦ‡ī¸ Installation
53
+
54
+ Install the library using pip:
55
+
56
+ ```bash
57
+ pip install rankjie-pypetkitapi
58
+ ```
59
+
60
+ ## 💡 Usage Example:
61
+
62
+ Here is a simple example of how to use the library to interact with the PetKit API \
63
+ This example is not an exhaustive list of all the features available in the library.
64
+
65
+ ```python
66
+ import asyncio
67
+ import logging
68
+ import aiohttp
69
+ from pypetkitapi.client import PetKitClient
70
+ from pypetkitapi.command import DeviceCommand, FeederCommand, LBCommand, DeviceAction, LitterCommand
71
+
72
+ logging.basicConfig(level=logging.DEBUG)
73
+
74
+ async def main():
75
+ async with aiohttp.ClientSession() as session:
76
+ client = PetKitClient(
77
+ username="username", # Your PetKit account username or id
78
+ password="password", # Your PetKit account password
79
+ region="FR", # Your region or country code (e.g. FR, US,CN etc.)
80
+ timezone="Europe/Paris", # Your timezone(e.g. "Asia/Shanghai")
81
+ session=session,
82
+ )
83
+
84
+ await client.get_devices_data()
85
+
86
+ # Lists all devices and pet from account
87
+
88
+ for key, value in client.petkit_entities.items():
89
+ print(f"{key}: {type(value).__name__} - {value.name}")
90
+
91
+ # Select a device
92
+ device_id = key
93
+ # Read devices or pet information
94
+ print(client.petkit_entities[device_id])
95
+
96
+ # Send command to the devices
97
+ ### Example 1 : Turn on the indicator light
98
+ ### Device_ID, Command, Payload
99
+ await client.send_api_request(device_id, DeviceCommand.UPDATE_SETTING, {"lightMode": 1})
100
+
101
+ ### Example 2 : Feed the pet
102
+ ### Device_ID, Command, Payload
103
+ # simple hopper :
104
+ await client.send_api_request(device_id, FeederCommand.MANUAL_FEED, {"amount": 1})
105
+ # dual hopper :
106
+ await client.send_api_request(device_id, FeederCommand.MANUAL_FEED, {"amount1": 2})
107
+ # or
108
+ await client.send_api_request(device_id, FeederCommand.MANUAL_FEED, {"amount2": 2})
109
+
110
+ ### Example 3 : Start the cleaning process
111
+ ### Device_ID, Command, Payload
112
+ await client.send_api_request(device_id, LitterCommand.CONTROL_DEVICE, {DeviceAction.START: LBCommand.CLEANING})
113
+
114
+
115
+ if __name__ == "__main__":
116
+ asyncio.run(main())
117
+ ```
118
+
119
+ ## 💡 More example usage
120
+
121
+ Check at the usage in the Home Assistant integration : [here](https://github.com/Jezza34000/homeassistant_petkit)
122
+
123
+ ## â˜‘ī¸ Supported Devices
124
+
125
+ | **Category** | **Name** | **Device** |
126
+ | ---------------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
127
+ | **🍗 Feeders** | ✅ Fresh Element | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/feeder.png" width="40"/></a> |
128
+ | | ✅ Fresh Element Mini Pro | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/feedermini.png" width="40"/></a> |
129
+ | | ✅ Fresh Element Infinity | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/d3.png" width="40"/></a> |
130
+ | | ✅ Fresh Element Solo | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/d4.png" width="40"/></a> |
131
+ | | ✅ Fresh Element Gemini | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/d4s.png" width="40"/></a> |
132
+ | | ✅ YumShare Solo | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/d4h.png" width="40"/></a> |
133
+ | | ✅ YumShare Dual-hopper | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/d4sh.png" width="40"/></a> |
134
+ | **đŸšŊ Litters** | ✅ PuraX | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/t3.png" width="40"/></a> |
135
+ | | ✅ PuraMax | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/t4.1.png" width="40"/></a> |
136
+ | | ✅ PuraMax 2 | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/t4.png" width="40"/></a> |
137
+ | | ✅ Purobot Max Pro | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/t5.png" width="40"/></a> |
138
+ | | ✅ Purobot Ultra | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/t6.png" width="40"/></a> |
139
+ | **⛲ Fountains** | ✅ Eversweet Solo 2 | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/5w5.png" width="40"/></a> |
140
+ | | ✅ Eversweet 3 Pro | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/4w5.png" width="40"/></a> |
141
+ | | ✅ Eversweet 3 Pro UVC | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/6w5.png" width="40"/></a> |
142
+ | | ✅ Eversweet 5 Mini | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/2w5.png" width="40"/></a> |
143
+ | | ✅ Eversweet Max | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/ctw3.png" width="40"/></a> |
144
+ | **🧴 Purifiers** | ✅ Air Magicube | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/k2.png" width="40"/></a> |
145
+ | | ✅ Air Smart Spray | <a href=""><img src="https://raw.githubusercontent.com/Jezza34000/homeassistant_petkit/refs/heads/main/images/devices/k3.png" width="40"/></a> |
146
+
147
+ ## 🛟 Help and Support
148
+
149
+ Developers? Want to help? Join us on our Discord channel dedicated to developers and contributors.
150
+
151
+ [![Discord][discord-shield]][discord]
152
+
153
+ ## 👨‍đŸ’ģ Contributing
154
+
155
+ Contributions are welcome!\
156
+ Please open an issue or submit a pull request.
157
+
158
+ ## License
159
+
160
+ This project is licensed under the MIT License. See the LICENSE file for details.
161
+
162
+ ---
163
+
164
+ [homeassistant_petkit]: https://github.com/Jezza34000/py-petkit-api
165
+ [commits-shield]: https://img.shields.io/github/commit-activity/y/Jezza34000/py-petkit-api.svg?style=flat
166
+ [commits]: https://github.com/Jezza34000/py-petkit-api/commits/main
167
+ [discord]: https://discord.gg/Va8DrmtweP
168
+ [discord-shield]: https://img.shields.io/discord/1318098700379361362.svg?style=for-the-badge&label=Discord&logo=discord&color=5865F2
169
+ [forum-shield]: https://img.shields.io/badge/community-forum-brightgreen.svg?style=for-the-badge&label=Home%20Assistant%20Community&logo=homeassistant&color=18bcf2
170
+ [forum]: https://community.home-assistant.io/t/petkit-integration/834431
171
+ [license-shield]: https://img.shields.io/github/license/Jezza34000/py-petkit-api.svg??style=flat
172
+ [maintenance-shield]: https://img.shields.io/badge/maintainer-Jezza34000-blue.svg?style=flat
173
+ [releases-shield]: https://img.shields.io/github/release/Jezza34000/py-petkit-api.svg?style=for-the-badge&color=41BDF5
174
+ [releases]: https://github.com/Jezza34000/py-petkit-api/releases
175
+ [github-sponsor-shield]: https://img.shields.io/badge/sponsor-Jezza34000-blue.svg?style=for-the-badge&logo=githubsponsors&color=EA4AAA
176
+ [github-sponsor]: https://github.com/sponsors/Jezza34000
177
+ [buymeacoffee-shield]: https://img.shields.io/badge/Donate-buy_me_a_coffee-yellow.svg?style=for-the-badge&logo=buy-me-a-coffee
178
+ [buymeacoffee]: https://www.buymeacoffee.com/jezza
@@ -0,0 +1,116 @@
1
+ """Pypetkit: A Python library for interfacing with PetKit"""
2
+
3
+ from .client import PetKitClient
4
+ from .command import (
5
+ DeviceAction,
6
+ DeviceCommand,
7
+ FeederCommand,
8
+ FountainCommand,
9
+ LBCommand,
10
+ LitterCommand,
11
+ PetCommand,
12
+ PurMode,
13
+ )
14
+ from .const import (
15
+ CTW3,
16
+ D3,
17
+ D4,
18
+ D4H,
19
+ D4S,
20
+ D4SH,
21
+ DEVICES_FEEDER,
22
+ DEVICES_LITTER_BOX,
23
+ DEVICES_PURIFIER,
24
+ DEVICES_WATER_FOUNTAIN,
25
+ FEEDER,
26
+ FEEDER_MINI,
27
+ FEEDER_WITH_CAMERA,
28
+ K2,
29
+ K3,
30
+ LITTER_NO_CAMERA,
31
+ LITTER_WITH_CAMERA,
32
+ T3,
33
+ T4,
34
+ T5,
35
+ T6,
36
+ T7,
37
+ W5,
38
+ BluetoothState,
39
+ MediaType,
40
+ RecordType,
41
+ )
42
+ from .containers import IotInfo, LiveFeed, NewIotInfo, Pet
43
+ from .exceptions import (
44
+ PetkitAuthenticationUnregisteredEmailError,
45
+ PetkitRegionalServerNotFoundError,
46
+ PetkitSessionError,
47
+ PetkitSessionExpiredError,
48
+ PetkitTimeoutError,
49
+ PypetkitError,
50
+ )
51
+ from .feeder_container import Feeder, RecordsItems
52
+ from .litter_container import Litter, LitterRecord, WorkState
53
+ from .media import DownloadDecryptMedia, MediaCloud, MediaFile, MediaManager
54
+ from .purifier_container import Purifier
55
+ from .water_fountain_container import WaterFountain
56
+
57
+ __version__ = "1.3.0.dev1"
58
+
59
+ __all__ = [
60
+ "CTW3",
61
+ "D3",
62
+ "D4",
63
+ "D4H",
64
+ "D4S",
65
+ "D4SH",
66
+ "DEVICES_FEEDER",
67
+ "DEVICES_LITTER_BOX",
68
+ "DEVICES_PURIFIER",
69
+ "DEVICES_WATER_FOUNTAIN",
70
+ "FEEDER",
71
+ "FEEDER_MINI",
72
+ "FEEDER_WITH_CAMERA",
73
+ "K2",
74
+ "K3",
75
+ "LITTER_NO_CAMERA",
76
+ "LITTER_WITH_CAMERA",
77
+ "T3",
78
+ "T4",
79
+ "T5",
80
+ "T6",
81
+ "T7",
82
+ "W5",
83
+ "BluetoothState",
84
+ "DeviceAction",
85
+ "DeviceCommand",
86
+ "DownloadDecryptMedia",
87
+ "Feeder",
88
+ "FeederCommand",
89
+ "FountainCommand",
90
+ "IotInfo",
91
+ "LBCommand",
92
+ "Litter",
93
+ "LitterCommand",
94
+ "LitterRecord",
95
+ "LiveFeed",
96
+ "MediaCloud",
97
+ "MediaFile",
98
+ "MediaManager",
99
+ "MediaType",
100
+ "NewIotInfo",
101
+ "Pet",
102
+ "PetCommand",
103
+ "PetKitClient",
104
+ "PetkitAuthenticationUnregisteredEmailError",
105
+ "PetkitRegionalServerNotFoundError",
106
+ "PetkitSessionError",
107
+ "PetkitSessionExpiredError",
108
+ "PetkitTimeoutError",
109
+ "PurMode",
110
+ "Purifier",
111
+ "PypetkitError",
112
+ "RecordType",
113
+ "RecordsItems",
114
+ "WaterFountain",
115
+ "WorkState",
116
+ ]