signalk-polar-performance-plugin 0.0.43 → 0.0.44

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": "signalk-polar-performance-plugin",
3
- "version": "0.0.43",
3
+ "version": "0.0.44",
4
4
  "description": "A plugin that calculates performance information based on a (CSV) polar diagram.",
5
5
  "main": "plugin/index.js",
6
6
  "scripts": {
package/plugin/index.js CHANGED
@@ -86,6 +86,7 @@ module.exports = function (app) {
86
86
 
87
87
 
88
88
  plugin.start = function (options, restartPlugin) {
89
+ firstUpdate = true
89
90
  // Here we put our plugin logic
90
91
  app.debug('Plugin started');
91
92
  app.debug('Options: %s', JSON.stringify(options))
@@ -259,14 +260,16 @@ module.exports = function (app) {
259
260
  }
260
261
 
261
262
  app.debug('sendUpdates: %s', JSON.stringify(values))
262
- app.handleMessage(plugin.id, {
263
- updates: [
263
+ let updates = { updates: [
264
264
  {
265
265
  values: values,
266
- meta: metas
267
266
  }
268
- ]
269
- })
267
+ ]}
268
+ if (firstUpdate) {
269
+ updates.updates[0].metas = metas
270
+ firstUpdate = false
271
+ }
272
+ app.handleMessage(plugin.id, updates)
270
273
  }
271
274
 
272
275
  function getPerformanceData (TWS, TWA, BSP) {