Skip to content

Commit

Permalink
Fix logging lines
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianGarside committed Apr 16, 2024
1 parent 4d86e50 commit 7ce9992
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions custom_components/bambu_lab/pybambu/bambu_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion custom_components/bambu_lab/pybambu/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions release_notes.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 7ce9992

Please sign in to comment.