Skip to content

Commit

Permalink
Merge pull request #82 from Jalle19/verify-modbus-address
Browse files Browse the repository at this point in the history
Include the device's Modbus address in device information
  • Loading branch information
Jalle19 authored Aug 14, 2023
2 parents 1832b36 + 04b0de6 commit 58f31d3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Add missing error handling to the `/summary` route, change HTTP error responses to return JSON
* Add `-v` option which enables debug logging
* Start using ESLint, add `no-console` rule to enforce use of logger instances
* Include the unit's Modbus address in the device information

## 2.3.2

Expand Down
6 changes: 6 additions & 0 deletions app/modbus.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,12 @@ export const getDeviceInformation = async (modbusClient) => {
'modelName': createModelNameString(deviceInformation),
}

result = await mutex.runExclusive(async () => tryReadHoldingRegisters(modbusClient, 640, 1))
deviceInformation = {
...deviceInformation,
'modbusAddress': result.data[0],
}

return deviceInformation
}

Expand Down

0 comments on commit 58f31d3

Please sign in to comment.