pypetkitapi 1.16.5__tar.gz → 1.16.6__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.
- {pypetkitapi-1.16.5 → pypetkitapi-1.16.6}/PKG-INFO +1 -1
- {pypetkitapi-1.16.5 → pypetkitapi-1.16.6}/pypetkitapi/__init__.py +1 -1
- {pypetkitapi-1.16.5 → pypetkitapi-1.16.6}/pypetkitapi/bluetooth.py +1 -1
- {pypetkitapi-1.16.5 → pypetkitapi-1.16.6}/pypetkitapi/containers.py +8 -1
- {pypetkitapi-1.16.5 → pypetkitapi-1.16.6}/pyproject.toml +3 -2
- {pypetkitapi-1.16.5 → pypetkitapi-1.16.6}/LICENSE +0 -0
- {pypetkitapi-1.16.5 → pypetkitapi-1.16.6}/README.md +0 -0
- {pypetkitapi-1.16.5 → pypetkitapi-1.16.6}/pypetkitapi/client.py +0 -0
- {pypetkitapi-1.16.5 → pypetkitapi-1.16.6}/pypetkitapi/command.py +0 -0
- {pypetkitapi-1.16.5 → pypetkitapi-1.16.6}/pypetkitapi/const.py +0 -0
- {pypetkitapi-1.16.5 → pypetkitapi-1.16.6}/pypetkitapi/exceptions.py +0 -0
- {pypetkitapi-1.16.5 → pypetkitapi-1.16.6}/pypetkitapi/feeder_container.py +0 -0
- {pypetkitapi-1.16.5 → pypetkitapi-1.16.6}/pypetkitapi/litter_container.py +0 -0
- {pypetkitapi-1.16.5 → pypetkitapi-1.16.6}/pypetkitapi/media.py +0 -0
- {pypetkitapi-1.16.5 → pypetkitapi-1.16.6}/pypetkitapi/purifier_container.py +0 -0
- {pypetkitapi-1.16.5 → pypetkitapi-1.16.6}/pypetkitapi/py.typed +0 -0
- {pypetkitapi-1.16.5 → pypetkitapi-1.16.6}/pypetkitapi/schedule_container.py +0 -0
- {pypetkitapi-1.16.5 → pypetkitapi-1.16.6}/pypetkitapi/utils.py +0 -0
- {pypetkitapi-1.16.5 → pypetkitapi-1.16.6}/pypetkitapi/water_fountain_container.py +0 -0
@@ -185,7 +185,7 @@ class BluetoothManager:
|
|
185
185
|
:return: The BLE command code and the encoded BLE data.
|
186
186
|
"""
|
187
187
|
cmd_code = fountain_command[0]
|
188
|
-
modified_command = fountain_command[:2]
|
188
|
+
modified_command = [*fountain_command[:2], counter, *fountain_command[2:]]
|
189
189
|
ble_data = [*BLE_START_TRAME, *modified_command, *BLE_END_TRAME]
|
190
190
|
encoded_data = await self._encode_ble_data(ble_data)
|
191
191
|
return cmd_code, encoded_data
|
@@ -55,13 +55,20 @@ class Device(BaseModel):
|
|
55
55
|
|
56
56
|
created_at: int = Field(alias="createdAt")
|
57
57
|
device_id: int = Field(alias="deviceId")
|
58
|
-
device_name: str = Field(alias="deviceName")
|
58
|
+
device_name: str | None = Field("unnamed_device", alias="deviceName")
|
59
59
|
device_type: str = Field(alias="deviceType")
|
60
60
|
group_id: int = Field(alias="groupId")
|
61
61
|
type: int
|
62
62
|
type_code: int = Field(0, alias="typeCode")
|
63
63
|
unique_id: str = Field(alias="uniqueId")
|
64
64
|
|
65
|
+
@field_validator("device_name", mode="before")
|
66
|
+
def set_default_name(cls, value): # noqa: N805
|
67
|
+
"""Set default device_name if None or empty to avoid issues."""
|
68
|
+
if value is None or not isinstance(value, str) or not value.strip():
|
69
|
+
return "unnamed_device"
|
70
|
+
return value.lower()
|
71
|
+
|
65
72
|
@field_validator("device_name", "device_type", "unique_id", mode="before")
|
66
73
|
def convert_to_lower(cls, value): # noqa: N805
|
67
74
|
"""Convert device_name, device_type and unique_id to lowercase."""
|
@@ -116,6 +116,7 @@ ignore = [
|
|
116
116
|
"E501", # line too long
|
117
117
|
|
118
118
|
"PLC1901", # {existing} can be simplified to {replacement} as an empty string is falsey; too many false positives
|
119
|
+
"PLC0415", # import should be at the top-level of a file
|
119
120
|
"PLR0911", # Too many return statements ({returns} > {max_returns})
|
120
121
|
"PLR0912", # Too many branches ({branches} > {max_branches})
|
121
122
|
"PLR0913", # Too many arguments to function call ({c_args} > {max_args})
|
@@ -186,7 +187,7 @@ build-backend = "poetry.core.masonry.api"
|
|
186
187
|
|
187
188
|
[tool.poetry]
|
188
189
|
name = "pypetkitapi"
|
189
|
-
version = "1.16.
|
190
|
+
version = "1.16.6"
|
190
191
|
description = "Python client for PetKit API"
|
191
192
|
authors = ["Jezza34000 <info@mail.com>"]
|
192
193
|
readme = "README.md"
|
@@ -208,7 +209,7 @@ ruff = "^0.8.1"
|
|
208
209
|
types-aiofiles = "^24.1.0.20240626"
|
209
210
|
|
210
211
|
[tool.bumpver]
|
211
|
-
current_version = "1.16.
|
212
|
+
current_version = "1.16.6"
|
212
213
|
version_pattern = "MAJOR.MINOR.PATCH"
|
213
214
|
commit_message = "bump version {old_version} -> {new_version}"
|
214
215
|
tag_message = "{new_version}"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|