Skip to content

Commit

Permalink
Merge pull request #1311 from ep1cman/fix/mobbus-error-parse
Browse files Browse the repository at this point in the history
Fix modbus error parsing
  • Loading branch information
Bastian-Krause committed Dec 21, 2023
2 parents 3a01d08 + e5967f2 commit 1c3aac1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions labgrid/driver/modbusdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ def on_deactivate(self):
self.client = None

def _handle_error(self, action):
error_code = self.client.last_error()
error_code = self.client.last_error
if error_code == self._consts.MB_EXCEPT_ERR:
exc = self.client.last_except()
exc = self.client.last_except
if exc not in [self._consts.EXP_ACKNOWLEDGE, self._consts.EXP_NONE]:
raise ExecutionError(
f'Could not {action} coil (code={error_code}/exception={exc})')
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ doc = [
docker = ["docker>=5.0.2"]
graph = ["graphviz>=0.17.0"]
kasa = ["python-kasa>=0.4.0"]
modbus = ["pyModbusTCP>=0.1.10"]
modbus = ["pyModbusTCP>=0.2.0"]
modbusrtu = ["minimalmodbus>=1.0.2"]
mqtt = ["paho-mqtt>=1.5.1"]
onewire = ["onewire>=0.2"]
Expand Down

0 comments on commit 1c3aac1

Please sign in to comment.