dbus-victron-virtual 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dbus-victron-virtual",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "Add interoperability with victron dbus to a given dbus interface",
5
5
  "main": "src/index.js",
6
6
  "type": "commonjs",
@@ -28,8 +28,9 @@ describe("victron-dbus-virtual, GetValue and GetItems being called on us", () =>
28
28
  ]);
29
29
 
30
30
  // GetValue on path / returns all props (therefore nested array)
31
+ // but without the leading slash
31
32
  const rootValueResult = calls[0][0].GetValue();
32
- expect(rootValueResult).toEqual([["/IntProp", ["i", 42]]]);
33
+ expect(rootValueResult).toEqual([["IntProp", ["i", 42]]]);
33
34
 
34
35
  // GetValue on path /IntProp returns the value as a variant
35
36
  const valueResult = calls[1][0].GetValue();
package/src/index.js CHANGED
@@ -10,6 +10,7 @@ const products = {
10
10
  heatpump: 0xc064,
11
11
  battery: 0xc065,
12
12
  pvinverter: 0xc066,
13
+ ev: 0xc067,
13
14
  };
14
15
 
15
16
  function getType(value) {
@@ -288,7 +289,7 @@ function addVictronInterfaces(
288
289
  GetValue: function () {
289
290
  return Object.entries(declaration.properties || {}).map(([k, v]) => {
290
291
  debug("GetValue, definition[k] and v:", definition[k], v);
291
- return [k.replace(/^(?!\/)/, "/"), wrapValue(v, definition[k])];
292
+ return [k.replace(/^(?!\/)/, ""), wrapValue(v, definition[k])];
292
293
  });
293
294
  },
294
295
  emit: function () { },