Skip to content

Commit

Permalink
try again with error
Browse files Browse the repository at this point in the history
  • Loading branch information
spacemanspiff2007 committed Apr 8, 2024
1 parent 750580b commit 7b199b9
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ jobs:
python setup.py sdist bdist_wheel
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@release/v1
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repos:
- id: check-builtin-literals
- id: check-docstring-first
- id: check-merge-conflict
# - id: check-toml
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
Expand Down
2 changes: 1 addition & 1 deletion requirements_setup.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ aiomqtt == 2.0.1
pyserial-asyncio == 0.6
easyconfig == 0.3.2
pydantic == 2.6.4
smllib == 1.3
smllib == 1.4
aiohttp == 3.9.3
2 changes: 1 addition & 1 deletion src/sml2mqtt/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '3.0.DEV-4'
__version__ = '3.0.DEV-5'
1 change: 0 additions & 1 deletion src/sml2mqtt/const/sml_helpers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from __future__ import annotations

import traceback
from binascii import b2a_hex
from time import monotonic
from typing import TYPE_CHECKING, Any, Final
Expand Down
4 changes: 3 additions & 1 deletion src/sml2mqtt/sml_device/sml_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ def on_source_data(self, data: bytes):
self.on_error(e)

def on_error(self, e: Exception, *, show_traceback: bool = True):
self.log.debug(f'Exception {type(e)}: "{e}"')

# Log exception
if isinstance(e, Sml2MqttExceptionWithLog):
e.log_msg(self.log)
Expand All @@ -116,7 +118,7 @@ def on_error(self, e: Exception, *, show_traceback: bool = True):
for line in traceback.format_exc().splitlines():
self.log.error(line)
else:
self.log.error(e)
self.log.error(f'{type(e)}: {e}')

# Signal that an error occurred
self.set_status(DeviceStatus.ERROR)
Expand Down

0 comments on commit 7b199b9

Please sign in to comment.