Skip to content

Commit

Permalink
make it schema agnostic and fix issue (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
sailoog authored Mar 27, 2022
1 parent 78115e8 commit 96ced22
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
10 changes: 2 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
const signalkSchema = require('@signalk/signalk-schema')
const Bacon = require('baconjs')

const relevantKeys = Object.keys(signalkSchema.metadata)
.filter(s => s.indexOf('/vessels/*') >= 0)
.map(s => s.replace('/vessels/*', '').replace(/\//g, '.').replace(/RegExp/g, '*').substring(1)).sort()

module.exports = function(app) {
var plugin = {}
var unsubscribes = []
Expand All @@ -31,8 +26,7 @@ module.exports = function(app) {
"key": {
title: "Path",
type: "string",
default: "",
"enum": relevantKeys
default: ""
},
"zones": {
"type": "array",
Expand Down Expand Up @@ -108,7 +102,7 @@ module.exports = function(app) {
return value => value < zone.upper
}
} else {
return value => value > zone.upper
return value => value > zone.lower
}
})
acc.push(stream.map(value => {
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"author": "teppo.kurki@iki,fi",
"license": "ISC",
"dependencies": {
"@signalk/signalk-schema": "1.0.2",
"baconjs": "^0.7.88"
}
}

0 comments on commit 96ced22

Please sign in to comment.