Skip to content

Commit

Permalink
fix: Use debug level for disconnect callback as it happens often when
Browse files Browse the repository at this point in the history
battery is low
  • Loading branch information
sopelj committed Oct 26, 2023
1 parent 938c042 commit f796c83
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## [0.8.1]

### Changed

* Use debug level for disconnect callback instead of warning

### Fixed

* Don't require adapter keyword for other backends
Expand Down
2 changes: 1 addition & 1 deletion ember_mug/mug.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def _disconnect_callback(self, client: BleakClient) -> None:
if self._expected_disconnect:
logger.debug("Disconnect callback called")
else:
logger.warning("Unexpectedly disconnected")
logger.debug("Unexpectedly disconnected")

def _fire_callbacks(self) -> None:
"""Fire the callbacks."""
Expand Down
2 changes: 1 addition & 1 deletion tests/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def test_disconnect_callback(mock_logger: Mock, ember_mug: AsyncMock) -> None:

ember_mug._expected_disconnect = False
ember_mug._disconnect_callback(AsyncMock())
mock_logger.warning.assert_called_with("Unexpectedly disconnected")
mock_logger.debug.assert_called_with("Unexpectedly disconnected")


@patch("ember_mug.mug.logger")
Expand Down

0 comments on commit f796c83

Please sign in to comment.