Skip to content

Commit 605bf76

Browse files
committed
Log OTA updates at INFO
1 parent 7765e7e commit 605bf76

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

mqterm/jobs.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,14 +184,16 @@ async def update(self, payload, seq):
184184
payload_len = len(payload)
185185

186186
if self.ready:
187-
self.logger.debug("Firmware data received")
188187
# If there is any data left in the buffer, write it to flash memory
189188
if self.buf_len > 0:
190189
self._write_block()
191190

192191
# Finalize the firmware update
193192
self._validate_firmware()
194193
self.partition.set_boot()
194+
self.logger.info(
195+
f"Firmware update complete, wrote {self.bytes_written} bytes"
196+
)
195197
else:
196198
# If this message would overflow the buffer, we're ready to write a block
197199
if self.buf_len + payload_len >= self.BLOCK_SIZE:
@@ -242,9 +244,6 @@ def _validate_firmware(self):
242244

243245
def output(self):
244246
"""Return the number of bytes written to the firmware file."""
245-
self.logger.debug(
246-
f"Firmware update complete, total bytes written: {self.bytes_written}"
247-
)
248247
return BytesIO(str(self.bytes_written).encode("utf-8"))
249248

250249

0 commit comments

Comments
 (0)