Skip to content

Commit

Permalink
Cope with deviceInstance changes
Browse files Browse the repository at this point in the history
And also start depending on dbus-native-victron instead of on
dbus-native.
  • Loading branch information
dirkjanfaber committed Oct 28, 2024
1 parent a57f74f commit 336534b
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 39 deletions.
68 changes: 31 additions & 37 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Custom Node-RED Nodes for Victron Energy",
"version": "1.5.23",
"dependencies": {
"dbus-native": "^0.4.0",
"dbus-native-victron": "^0.4.2",
"debug": "^4.3.7",
"lodash": "^4.17.21",
"promise-retry": "^2.0.1",
Expand Down
5 changes: 4 additions & 1 deletion src/services/dbus-listener.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* https://github.com/sbender9/signalk-venus-plugin/blob/master/dbus-listener.js
*/

const dbus = require('dbus-native')
const dbus = require('dbus-native-victron')
const debug = require('debug')('node-red-contrib-victron:dbus')
const _ = require('lodash')

Expand Down Expand Up @@ -230,6 +230,9 @@ class VictronDbusListener {
if (!service || !service.name) {
return
}
if (m.path === '/DeviceInstance') {
service.deviceInstance = m.value
}
m.senderName = service.name.split('.').splice(0, 3).join('.')
if (service.deviceInstance === null) {
service.deviceInstance = searchDeviceInstanceByName(this.services, m.senderName, '')
Expand Down

0 comments on commit 336534b

Please sign in to comment.