diff --git a/custom_components/bambu_lab/pybambu/bambu_client.py b/custom_components/bambu_lab/pybambu/bambu_client.py index 1d9c751e..633d1498 100644 --- a/custom_components/bambu_lab/pybambu/bambu_client.py +++ b/custom_components/bambu_lab/pybambu/bambu_client.py @@ -243,27 +243,27 @@ def run(self): break except TimeoutError as e: if exceptionSeen != "TimeoutError": - LOGGER.debug("TimeoutError: {e}.") + LOGGER.debug(f"TimeoutError: {e}.") exceptionSeen = "TimeoutError" time.sleep(5) except ConnectionError as e: if exceptionSeen != "ConnectionError": - LOGGER.debug("ConnectionError: {e}.") + LOGGER.debug(f"ConnectionError: {e}.") exceptionSeen = "ConnectionError" time.sleep(5) except OSError as e: if e.errno == 113: if exceptionSeen != "OSError113": - LOGGER.debug("OSError: {e}.") + LOGGER.debug(f"OSError: {e}.") exceptionSeen = "OSError113" time.sleep(5) else: LOGGER.error("A listener loop thread exception occurred:") - LOGGER.error("Exception. Type: {type(e)} Args: {e}") + LOGGER.error(f"Exception. Type: {type(e)} Args: {e}") time.sleep(1) # Avoid a tight loop if this is a persistent error. except Exception as e: LOGGER.error("A listener loop thread exception occurred:") - LOGGER.error("Exception. Type: {type(e)} Args: {e}") + LOGGER.error(f"Exception. Type: {type(e)} Args: {e}") time.sleep(1) # Avoid a tight loop if this is a persistent error. if self._client.client is None: @@ -403,7 +403,7 @@ def _on_disconnect(self): self._watchdog.stop() self._watchdog.join() if self._camera is not None: - LOGGER.warn(f"Stopping camera thread") + LOGGER.warn("Stopping camera thread") self._camera.stop() self._camera.join() diff --git a/custom_components/bambu_lab/pybambu/models.py b/custom_components/bambu_lab/pybambu/models.py index 4fab2a66..bde0922e 100644 --- a/custom_components/bambu_lab/pybambu/models.py +++ b/custom_components/bambu_lab/pybambu/models.py @@ -456,7 +456,7 @@ def print_update(self, data) -> bool: # Calculate start / end time after we update task data so we don't stomp on prepopulated values while idle on integration start. if data.get("gcode_start_time") is not None: if self.start_time != get_start_time(int(data.get("gcode_start_time"))): - LOGGER.debug("GCODE START TIME: {self.start_time}") + LOGGER.debug(f"GCODE START TIME: {self.start_time}") self.start_time = get_start_time(int(data.get("gcode_start_time"))) # Generate the end_time from the remaining_time mqtt payload value if present. diff --git a/release_notes.md b/release_notes.md index 7a66a7fc..41a605e3 100644 --- a/release_notes.md +++ b/release_notes.md @@ -1,5 +1,6 @@ ### V2.0.16 - Handle home assistant shutdown more gracefully +- Fix threading bug causing severe instability for some folk on newer HA versions. ### V2.0.15 - Add lost fix for usage hours from prototype branch