pypetkitapi 1.2.2__py3-none-any.whl → 1.2.4__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/client.py CHANGED
@@ -44,9 +44,7 @@ _LOGGER = logging.getLogger(__name__)
44
44
  class PetKitClient:
45
45
  """Petkit Client"""
46
46
 
47
- _base_url: str
48
47
  _session: SessionInfo | None = None
49
- _servers_list: list[RegionInfo] = []
50
48
  account_data: list[AccountData] = []
51
49
  petkit_entities: dict[int, Feeder | Litter | WaterFountain | Pet] = {}
52
50
 
@@ -75,7 +73,7 @@ class PetKitClient:
75
73
  _LOGGER.debug("Getting API server list")
76
74
 
77
75
  if self.region.lower() == "china":
78
- self._base_url = PetkitDomain.CHINA_SRV
76
+ self.req.base_url = PetkitDomain.CHINA_SRV
79
77
  return
80
78
 
81
79
  response = await self.req.request(
@@ -173,6 +173,7 @@ class EventState(BaseModel):
173
173
  completed_at: str | None = Field(None, alias="completedAt")
174
174
  err_code: int | None = Field(None, alias="errCode")
175
175
  media: int | None = None
176
+ real_amount: int | None = Field(None, alias="realAmount")
176
177
  real_amount1: int | None = Field(None, alias="realAmount1")
177
178
  real_amount2: int | None = Field(None, alias="realAmount2")
178
179
  result: int | None = None
@@ -183,55 +184,61 @@ class RecordsItems(BaseModel):
183
184
  """Dataclass for records items data."""
184
185
 
185
186
  aes_key: str | None = Field(None, alias="aesKey")
186
- duration: int | None = None
187
- event_id: str | None = Field(None, alias="eventId")
188
- expire: int | None = None
189
- mark: int | None = None
190
- media_api: str | None = Field(None, alias="mediaApi")
191
- start_time: int | None = Field(None, alias="startTime")
192
- storage_space: int | None = Field(None, alias="storageSpace")
193
- eat_video: int | None = Field(None, alias="eatVideo")
194
- is_need_upload_video: int | None = Field(None, alias="isNeedUploadVideo")
195
- preview: str | None = None
196
- time: int | None = None
197
- timestamp: int | None = None
198
187
  aes_key1: str | None = Field(None, alias="aesKey1")
199
188
  aes_key2: str | None = Field(None, alias="aesKey2")
189
+ amount: int | None = Field(None, alias="amount")
200
190
  amount1: int | None = Field(None, alias="amount1")
201
191
  amount2: int | None = Field(None, alias="amount2")
202
192
  completed_at: int | None = Field(None, alias="completedAt")
203
193
  content: dict[str, Any] | None = None
204
194
  desc: str | None = None
205
195
  device_id: int | None = Field(None, alias="deviceId")
196
+ duration: int | None = None
206
197
  eat_end_time: int | None = Field(None, alias="eatEndTime")
207
198
  eat_start_time: int | None = Field(None, alias="eatStartTime")
199
+ eat_video: int | None = Field(None, alias="eatVideo")
208
200
  empty: int | None = None
209
201
  end_time: int | None = Field(None, alias="endTime")
210
202
  enum_event_type: str | None = Field(None, alias="enumEventType")
211
203
  event: str | None = None
204
+ event_id: str | None = Field(None, alias="eventId")
212
205
  event_type: int | None = Field(None, alias="eventType")
206
+ expire: int | None = None
213
207
  expire1: int | None = Field(None, alias="expire1")
214
208
  expire2: int | None = Field(None, alias="expire2")
215
209
  id: str | None = None
216
210
  is_executed: int | None = Field(None, alias="isExecuted")
211
+ is_need_upload_video: int | None = Field(None, alias="isNeedUploadVideo")
212
+ mark: int | None = None
213
+ media_api: str | None = Field(None, alias="mediaApi")
217
214
  media_list: list[Any] | None = Field(None, alias="mediaList")
218
215
  name: str | None = None
216
+ preview: str | None = None
219
217
  preview1: str | None = Field(None, alias="preview1")
220
218
  preview2: str | None = Field(None, alias="preview2")
221
219
  src: int | None = None
220
+ start_time: int | None = Field(None, alias="startTime")
222
221
  state: EventState | None = None
223
222
  status: int | None = None
223
+ storage_space: int | None = Field(None, alias="storageSpace")
224
+ time: int | None = None
225
+ timestamp: int | None = None
224
226
 
225
227
 
226
228
  class RecordsType(BaseModel):
227
229
  """Dataclass for records type data."""
228
230
 
231
+ add_amount: int | None = Field(None, alias="addAmount")
229
232
  add_amount1: int | None = Field(None, alias="addAmount1")
230
233
  add_amount2: int | None = Field(None, alias="addAmount2")
231
234
  day: int | None = None
232
235
  device_id: int | None = Field(None, alias="deviceId")
233
236
  eat_count: int | None = Field(None, alias="eatCount")
234
237
  items: list[RecordsItems] | None = None
238
+ plan_amount: int | None = Field(None, alias="planAmount")
239
+ real_amount: int | None = Field(None, alias="realAmount")
240
+ amount: int | None = None
241
+ times: int | None = None
235
242
 
236
243
 
237
244
  class FeederRecord(BaseModel):
@@ -142,26 +142,54 @@ class StateLitter(BaseModel):
142
142
  work_state: WorkState | None = Field(None, alias="workState")
143
143
 
144
144
 
145
- class Content(BaseModel):
145
+ class ContentSC(BaseModel):
146
146
  """Dataclass for content data."""
147
147
 
148
148
  box: int | None = None
149
149
  box_full: bool | None = Field(None, alias="boxFull")
150
+ err: str | None = None
150
151
  litter_percent: int | None = Field(None, alias="litterPercent")
152
+ mark: int | None = None
153
+ media: int | None = None
151
154
  result: int | None = None
152
155
  start_reason: int | None = Field(None, alias="startReason")
153
156
  start_time: int | None = Field(None, alias="startTime")
157
+ upload: int | None = None
158
+
159
+
160
+ class LRContent(BaseModel):
161
+ """Dataclass for pet data."""
162
+
163
+ auto_clear: int | None = Field(None, alias="autoClear")
164
+ interval: int | None = None
165
+ pet_weight: int | None = Field(None, alias="petWeight")
166
+ time_in: int | None = Field(None, alias="timeIn")
167
+ time_out: int | None = Field(None, alias="timeOut")
168
+ error: int | None = None
154
169
 
155
170
 
156
- class SubContent(BaseModel):
171
+ class LRSubContent(BaseModel):
157
172
  """Dataclass for sub-content data."""
158
173
 
159
- content: Content | None = None
174
+ aes_key: str | None = Field(None, alias="aesKey")
175
+ content: ContentSC | None = None
160
176
  device_id: int | None = Field(None, alias="deviceId")
177
+ duration: int | None = None
161
178
  enum_event_type: str | None = Field(None, alias="enumEventType")
179
+ event_id: str | None = Field(None, alias="eventId")
162
180
  event_type: int | None = Field(None, alias="eventType")
181
+ expire: int | None = None
182
+ mark: int | None = None
183
+ media: int | None = None
184
+ media_api: str | None = Field(None, alias="mediaApi")
185
+ preview: str | None = None
186
+ related_event: str | None = Field(None, alias="relatedEvent")
187
+ shit_aes_key: str | None = Field(None, alias="shitAesKey")
188
+ shit_picture: str | None = Field(None, alias="shitPicture")
189
+ storage_space: int | None = Field(None, alias="storageSpace")
163
190
  sub_content: list[Any] | None = Field(None, alias="subContent")
164
191
  timestamp: int | None = None
192
+ upload: int | None = None
165
193
  user_id: str | None = Field(None, alias="userId")
166
194
 
167
195
 
@@ -170,15 +198,28 @@ class LitterRecord(BaseModel):
170
198
 
171
199
  data_type: ClassVar[str] = DEVICE_RECORDS
172
200
 
201
+ aes_key: str | None = Field(None, alias="aesKey")
173
202
  avatar: str | None = None
174
- content: dict[str, Any] | None = None
203
+ content: LRContent | None = None
175
204
  device_id: int | None = Field(None, alias="deviceId")
205
+ duration: int | None = None
176
206
  enum_event_type: str | None = Field(None, alias="enumEventType")
207
+ event_id: str | None = Field(None, alias="eventId")
177
208
  event_type: int | None = Field(None, alias="eventType")
209
+ expire: int | None = None
210
+ is_need_upload_video: int | None = Field(None, alias="isNeedUploadVideo")
211
+ mark: int | None = None
212
+ media: int | None = None
213
+ media_api: str | None = Field(None, alias="mediaApi")
178
214
  pet_id: str | None = Field(None, alias="petId")
179
215
  pet_name: str | None = Field(None, alias="petName")
180
- sub_content: list[SubContent] | None = Field(None, alias="subContent")
216
+ preview: str | None = None
217
+ related_event: str | None = Field(None, alias="relatedEvent")
218
+ storage_space: int | None = Field(None, alias="storageSpace")
219
+ sub_content: list[LRSubContent] | None = Field(None, alias="subContent")
181
220
  timestamp: int | None = None
221
+ toilet_detection: int | None = Field(None, alias="toiletDetection")
222
+ upload: int | None = None
182
223
  user_id: str | None = Field(None, alias="userId")
183
224
  device_type: str | None = Field(None, alias="deviceType")
184
225
 
@@ -237,7 +278,7 @@ class Litter(BaseModel):
237
278
  service_status: int | None = Field(None, alias="serviceStatus")
238
279
  total_time: int | None = Field(None, alias="totalTime")
239
280
  device_type: str | None = Field(None, alias="deviceType")
240
- device_records: LitterRecord | None = None
281
+ device_records: list[LitterRecord] | None = None
241
282
 
242
283
  @classmethod
243
284
  def get_endpoint(cls, device_type: str) -> str:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pypetkitapi
3
- Version: 1.2.2
3
+ Version: 1.2.4
4
4
  Summary: Python client for PetKit API
5
5
  Home-page: https://github.com/Jezza34000/pypetkit
6
6
  License: MIT
@@ -1,14 +1,14 @@
1
1
  pypetkitapi/__init__.py,sha256=eVpyGMD3tkYtiHUkdKEeNSZhQlZ4woI2Y5oVoV7CwXM,61
2
- pypetkitapi/client.py,sha256=0f8wk5UkOtxr3VSF0yu-iFeetuaT9RLgd0URfypXx9w,16595
2
+ pypetkitapi/client.py,sha256=7-eWcDXxo2OtK_YN-MMmWo7g_O3FisjGJBTxR-FtVEU,16538
3
3
  pypetkitapi/command.py,sha256=gw3_J_oZHuuGLk66P8uRSqSrySjYa8ArpKaPHi2ybCw,7155
4
4
  pypetkitapi/const.py,sha256=Mxgezd9sy-LtpgjYuVKb9ii9HSUnz8FVyKx1GXbXBAU,3291
5
5
  pypetkitapi/containers.py,sha256=m7vzWcJG0U1EPftuBF6OB8eTVRhCoA2DFqekxI6LozI,3428
6
6
  pypetkitapi/exceptions.py,sha256=NWmpsI2ewC4HaIeu_uFwCeuPIHIJxZBzjoCP7aNwvhs,1139
7
- pypetkitapi/feeder_container.py,sha256=zGvMAfB4R0DoSTuw1MDhtehPb9bVcz9kAzNV6zhsA7o,12832
8
- pypetkitapi/litter_container.py,sha256=WfBOXMTuSjrohZWtGsIYhjqumK1BXzUWoytKFMsmzec,11698
7
+ pypetkitapi/feeder_container.py,sha256=8toLt9YSvEvjNSy9b6jwHSNZxuXP6D1ZnrnUdL78K6s,13190
8
+ pypetkitapi/litter_container.py,sha256=F16kIMlgqk97ewQrqsIPY6NX7qWvfQ2qM4If68Tq5Yg,13414
9
9
  pypetkitapi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  pypetkitapi/water_fountain_container.py,sha256=Lr1qc_hh2DKtIQEFMsLGJhRcguGhWn6-bm7UfBMT15A,6626
11
- pypetkitapi-1.2.2.dist-info/LICENSE,sha256=4FWnKolNLc1e3w6cVlT61YxfPh0DQNeQLN1CepKKSBg,1067
12
- pypetkitapi-1.2.2.dist-info/METADATA,sha256=929ixuYJI4XdFJPXdz0VzZsXH4-6haZ6db-R3i8_2Sg,4590
13
- pypetkitapi-1.2.2.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
14
- pypetkitapi-1.2.2.dist-info/RECORD,,
11
+ pypetkitapi-1.2.4.dist-info/LICENSE,sha256=4FWnKolNLc1e3w6cVlT61YxfPh0DQNeQLN1CepKKSBg,1067
12
+ pypetkitapi-1.2.4.dist-info/METADATA,sha256=NRf9Cu42Kl8Zngxerji1AIppGxN3Pojeq97bTDJGsYc,4590
13
+ pypetkitapi-1.2.4.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
14
+ pypetkitapi-1.2.4.dist-info/RECORD,,