pypetkitapi 1.16.5__py3-none-any.whl → 1.16.6__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/__init__.py +1 -1
- pypetkitapi/bluetooth.py +1 -1
- pypetkitapi/containers.py +8 -1
- {pypetkitapi-1.16.5.dist-info → pypetkitapi-1.16.6.dist-info}/METADATA +1 -1
- {pypetkitapi-1.16.5.dist-info → pypetkitapi-1.16.6.dist-info}/RECORD +7 -7
- {pypetkitapi-1.16.5.dist-info → pypetkitapi-1.16.6.dist-info}/LICENSE +0 -0
- {pypetkitapi-1.16.5.dist-info → pypetkitapi-1.16.6.dist-info}/WHEEL +0 -0
pypetkitapi/__init__.py
CHANGED
pypetkitapi/bluetooth.py
CHANGED
@@ -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
|
pypetkitapi/containers.py
CHANGED
@@ -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."""
|
@@ -1,9 +1,9 @@
|
|
1
|
-
pypetkitapi/__init__.py,sha256=
|
2
|
-
pypetkitapi/bluetooth.py,sha256=
|
1
|
+
pypetkitapi/__init__.py,sha256=goBSd-5R2ZUGhJ4jnWsnJ53NcJAllu10gqJfb_CnZEE,2107
|
2
|
+
pypetkitapi/bluetooth.py,sha256=VNoJ3E9WXzEfqRoWwKiemITKIt9aa9ICRzDvFuJ3PP0,9915
|
3
3
|
pypetkitapi/client.py,sha256=nZJnjcCi3T0rSbJ0yTMKIFJPgPH8hkAEPqMCnJ3Q0Pg,31101
|
4
4
|
pypetkitapi/command.py,sha256=zw4h1SCInG2T0-wAA_al59_FTL36TUZldtJkYKw6ATI,7655
|
5
5
|
pypetkitapi/const.py,sha256=7SDIADq3WxauFpDBARv9VxiCQTG2ZCYyShRLRCyf4WE,4832
|
6
|
-
pypetkitapi/containers.py,sha256=
|
6
|
+
pypetkitapi/containers.py,sha256=MWfSHLU-ZEIf220nv3-96U41PhCl9Gh6ETBV_SYBvV4,6648
|
7
7
|
pypetkitapi/exceptions.py,sha256=4BXUyYXLfZjNxdnOGJPjyE9ASIl7JmQphjws87jvHtE,1631
|
8
8
|
pypetkitapi/feeder_container.py,sha256=PhidWd5WpsZqtdKZy60PzE67YXgQfApjm8CqvMCHK3U,14743
|
9
9
|
pypetkitapi/litter_container.py,sha256=g3PCVN2Yz5JGVzXXQK_jq5LApTiQR-td9kzS8JKW3Sk,20580
|
@@ -13,7 +13,7 @@ pypetkitapi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
13
|
pypetkitapi/schedule_container.py,sha256=ycIHeQHkVILDp7ZBjaVdGI_9rhHrgqeKBfvQAX3JMGE,2071
|
14
14
|
pypetkitapi/utils.py,sha256=z7325kcJQUburnF28HSXrJMvY_gY9007K73Zwxp-4DQ,743
|
15
15
|
pypetkitapi/water_fountain_container.py,sha256=5J0b-fDZYcFLNX2El7fifv8H6JMhBCt-ttxSow1ozRQ,6787
|
16
|
-
pypetkitapi-1.16.
|
17
|
-
pypetkitapi-1.16.
|
18
|
-
pypetkitapi-1.16.
|
19
|
-
pypetkitapi-1.16.
|
16
|
+
pypetkitapi-1.16.6.dist-info/LICENSE,sha256=u5jNkZEn6YMrtN4Kr5rU3TcBJ5-eAt0qMx4JDsbsnzM,1074
|
17
|
+
pypetkitapi-1.16.6.dist-info/METADATA,sha256=LS7kMY8S3eplrNKxDBWmEDJg9PdiSxe9OWxogfCyMXU,12977
|
18
|
+
pypetkitapi-1.16.6.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
19
|
+
pypetkitapi-1.16.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|