Skip to content

Commit 0dc7a88

Browse files
Fix: Direct MQTT publish for fw request (payload is empty or chunk size and not a json)
1 parent 33e4701 commit 0dc7a88

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tb_device_mqtt.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -787,8 +787,9 @@ def __process_firmware(self):
787787
def __get_firmware(self):
788788
payload = '' if not self.__chunk_size or self.__chunk_size > self.firmware_info.get(FW_SIZE_ATTR, 0) \
789789
else str(self.__chunk_size).encode()
790-
self._publish_data(payload, f"v2/fw/request/{self.__firmware_request_id}/chunk/{self.__current_chunk}",
791-
1)
790+
self._client.publish(
791+
f"v2/fw/request/{self.__firmware_request_id}/chunk/{self.__current_chunk}",
792+
payload=payload, qos=1)
792793

793794
def __on_firmware_received(self, version_to):
794795
with open(self.firmware_info.get(FW_TITLE_ATTR), "wb") as firmware_file:

0 commit comments

Comments
 (0)