Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions adafruit_minimqtt/adafruit_minimqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ def ping(self) -> list[int]:
)
return rcs

def publish( # noqa: PLR0912, Too many branches
def publish( # noqa: PLR0912, PLR0915, Too many branches, Too many statements
self,
topic: str,
msg: Union[str, int, float, bytes],
Expand Down Expand Up @@ -700,7 +700,11 @@ def publish( # noqa: PLR0912, Too many branches
else:
raise ValueError("Invalid message data type.")
if len(msg) > MQTT_MSG_MAX_SZ:
raise ValueError(f"Message size larger than {MQTT_MSG_MAX_SZ} bytes.")
raise ValueError(f"Message size larger than protocol max {MQTT_MSG_MAX_SZ} bytes.")
if len(msg) > self._msg_size_lim:
raise ValueError(
f"Message size larger than configured limit {self._msg_size_lim} bytes."
)

self._valid_qos(qos)

Expand Down
Loading