pypetkitapi 1.12.3__tar.gz → 1.12.4__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.3
2
2
  Name: pypetkitapi
3
- Version: 1.12.3
3
+ Version: 1.12.4
4
4
  Summary: Python client for PetKit API
5
5
  License: MIT
6
6
  Author: Jezza34000
@@ -51,7 +51,7 @@ from .media import DownloadDecryptMedia, MediaCloud, MediaFile, MediaManager
51
51
  from .purifier_container import Purifier
52
52
  from .water_fountain_container import WaterFountain
53
53
 
54
- __version__ = "1.12.3"
54
+ __version__ = "1.12.4"
55
55
 
56
56
  __all__ = [
57
57
  "CTW3",
@@ -41,6 +41,9 @@ class BluetoothManager:
41
41
  if not isinstance(water_fountain, WaterFountain):
42
42
  _LOGGER.error("Water fountain with ID %s not found.", fountain_id)
43
43
  raise TypeError(f"Water fountain with ID {fountain_id} not found.")
44
+ if water_fountain.device_nfo is None:
45
+ raise ValueError(f"Device info not found for fountain {fountain_id}")
46
+
44
47
  return water_fountain
45
48
 
46
49
  async def check_relay_availability(self, fountain_id: int) -> bool:
@@ -94,7 +97,11 @@ class BluetoothManager:
94
97
  response = await self.client.req.request(
95
98
  method=HTTPMethod.POST,
96
99
  url=PetkitEndpoint.BLE_CONNECT,
97
- data={"bleId": fountain_id, "type": 24, "mac": water_fountain.mac},
100
+ data={
101
+ "bleId": fountain_id,
102
+ "type": water_fountain.device_nfo.type, # type: ignore[union-attr]
103
+ "mac": water_fountain.mac,
104
+ },
98
105
  headers=await self.client.get_session_id(),
99
106
  )
100
107
  if response != {"state": 1}:
@@ -111,7 +118,11 @@ class BluetoothManager:
111
118
  response = await self.client.req.request(
112
119
  method=HTTPMethod.POST,
113
120
  url=PetkitEndpoint.BLE_POLL,
114
- data={"bleId": fountain_id, "type": 24, "mac": water_fountain.mac},
121
+ data={
122
+ "bleId": fountain_id,
123
+ "type": water_fountain.device_nfo.type, # type: ignore[union-attr]
124
+ "mac": water_fountain.mac,
125
+ },
115
126
  headers=await self.client.get_session_id(),
116
127
  )
117
128
  if response == 1:
@@ -149,7 +160,11 @@ class BluetoothManager:
149
160
  await self.client.req.request(
150
161
  method=HTTPMethod.POST,
151
162
  url=PetkitEndpoint.BLE_CANCEL,
152
- data={"bleId": fountain_id, "type": 24, "mac": water_fountain.mac},
163
+ data={
164
+ "bleId": fountain_id,
165
+ "type": water_fountain.device_nfo.type, # type: ignore[union-attr]
166
+ "mac": water_fountain.mac,
167
+ },
153
168
  headers=await self.client.get_session_id(),
154
169
  )
155
170
  _LOGGER.debug("BLE connection closed successfully (id %s)", fountain_id)
@@ -206,7 +221,7 @@ class BluetoothManager:
206
221
  "cmd": cmd_code,
207
222
  "data": cmd_data,
208
223
  "mac": water_fountain.mac,
209
- "type": 24,
224
+ "type": water_fountain.device_nfo.type, # type: ignore[union-attr]
210
225
  },
211
226
  headers=await self.client.get_session_id(),
212
227
  )
@@ -322,7 +322,7 @@ class MediaManager:
322
322
  cp_sub = self.is_subscription_active(device_obj)
323
323
 
324
324
  if not feeder_id or not record.items:
325
- _LOGGER.warning("Missing feeder_id or items for record")
325
+ _LOGGER.debug("Missing feeder_id or items for record")
326
326
  return media_files
327
327
 
328
328
  for item in record.items:
@@ -187,7 +187,7 @@ build-backend = "poetry.core.masonry.api"
187
187
 
188
188
  [tool.poetry]
189
189
  name = "pypetkitapi"
190
- version = "1.12.3"
190
+ version = "1.12.4"
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.12.3"
212
+ current_version = "1.12.4"
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