pypetkitapi 1.2.0__tar.gz → 1.2.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pypetkitapi
3
- Version: 1.2.0
3
+ Version: 1.2.3
4
4
  Summary: Python client for PetKit API
5
5
  Home-page: https://github.com/Jezza34000/pypetkit
6
6
  License: MIT
@@ -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(
@@ -297,6 +295,13 @@ class PetKitClient:
297
295
  _LOGGER.error("Unexpected response type: %s", type(response))
298
296
  return
299
297
 
298
+ # Add the device type into dataclass
299
+ if isinstance(device_data, list):
300
+ for item in device_data:
301
+ item.device_type = device_type
302
+ else:
303
+ device_data.device_type = device_type
304
+
300
305
  if data_class.data_type == DEVICE_DATA:
301
306
  self.petkit_entities[device_id] = device_data
302
307
  _LOGGER.debug("Device data fetched OK for %s", device_type)
@@ -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):
@@ -147,21 +147,38 @@ class Content(BaseModel):
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
154
158
 
155
159
 
156
160
  class SubContent(BaseModel):
157
161
  """Dataclass for sub-content data."""
158
162
 
163
+ aes_key: str | None = Field(None, alias="aesKey")
159
164
  content: Content | None = None
160
165
  device_id: int | None = Field(None, alias="deviceId")
166
+ duration: int | None = None
161
167
  enum_event_type: str | None = Field(None, alias="enumEventType")
168
+ event_id: str | None = Field(None, alias="eventId")
162
169
  event_type: int | None = Field(None, alias="eventType")
170
+ expire: int | None = None
171
+ mark: int | None = None
172
+ media: int | None = None
173
+ media_api: str | None = Field(None, alias="mediaApi")
174
+ preview: str | None = None
175
+ related_event: str | None = Field(None, alias="relatedEvent")
176
+ shit_aes_key: str | None = Field(None, alias="shitAesKey")
177
+ shit_picture: str | None = Field(None, alias="shitPicture")
178
+ storage_space: int | None = Field(None, alias="storageSpace")
163
179
  sub_content: list[Any] | None = Field(None, alias="subContent")
164
180
  timestamp: int | None = None
181
+ upload: int | None = None
165
182
  user_id: str | None = Field(None, alias="userId")
166
183
 
167
184
 
@@ -170,15 +187,28 @@ class LitterRecord(BaseModel):
170
187
 
171
188
  data_type: ClassVar[str] = DEVICE_RECORDS
172
189
 
190
+ aes_key: str | None = Field(None, alias="aesKey")
173
191
  avatar: str | None = None
174
192
  content: dict[str, Any] | None = None
175
193
  device_id: int | None = Field(None, alias="deviceId")
194
+ duration: int | None = None
176
195
  enum_event_type: str | None = Field(None, alias="enumEventType")
196
+ event_id: str | None = Field(None, alias="eventId")
177
197
  event_type: int | None = Field(None, alias="eventType")
198
+ expire: int | None = None
199
+ is_need_upload_video: int | None = Field(None, alias="isNeedUploadVideo")
200
+ mark: int | None = None
201
+ media: int | None = None
202
+ media_api: str | None = Field(None, alias="mediaApi")
178
203
  pet_id: str | None = Field(None, alias="petId")
179
204
  pet_name: str | None = Field(None, alias="petName")
205
+ preview: str | None = None
206
+ related_event: str | None = Field(None, alias="relatedEvent")
207
+ storage_space: int | None = Field(None, alias="storageSpace")
180
208
  sub_content: list[SubContent] | None = Field(None, alias="subContent")
181
209
  timestamp: int | None = None
210
+ toilet_detection: int | None = Field(None, alias="toiletDetection")
211
+ upload: int | None = None
182
212
  user_id: str | None = Field(None, alias="userId")
183
213
  device_type: str | None = Field(None, alias="deviceType")
184
214
 
@@ -187,7 +187,7 @@ build-backend = "poetry.core.masonry.api"
187
187
 
188
188
  [tool.poetry]
189
189
  name = "pypetkitapi"
190
- version = "1.2.0"
190
+ version = "1.2.3"
191
191
  description = "Python client for PetKit API"
192
192
  authors = ["Jezza34000 <info@mail.com>"]
193
193
  readme = "README.md"
@@ -204,7 +204,7 @@ black = "^24.10.0"
204
204
  ruff = "^0.8.1"
205
205
 
206
206
  [tool.bumpver]
207
- current_version = "1.2.0"
207
+ current_version = "1.2.3"
208
208
  version_pattern = "MAJOR.MINOR.PATCH"
209
209
  commit_message = "bump version {old_version} -> {new_version}"
210
210
  tag_message = "{new_version}"
File without changes
File without changes