@meri-imperiumi/signalk-mob-notifier 1.0.1 → 1.0.3
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/README.md +1 -1
- package/package.json +3 -3
- package/plugin/index.js +4 -4
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Signal K MOB notifier plugin
|
|
2
2
|
============================
|
|
3
3
|
|
|
4
|
-
This plugin detects if Signal K has seen an AIS MOB (MMSI starting with `972`) or SART (MMSI starting with `970`) beacon. If a beacon is detected, a [Signal K notification](https://signalk.org/specification/1.5.0/doc/notifications.html) will be raised. With the notification there are various ways to alert the crew:
|
|
4
|
+
This plugin detects if Signal K has seen an AIS MOB (MMSI starting with `972`), EPIRB (MMSI starting with `974`), or SART (MMSI starting with `970`) beacon. If a beacon is detected, a [Signal K notification](https://signalk.org/specification/1.5.0/doc/notifications.html) will be raised. With the notification there are various ways to alert the crew:
|
|
5
5
|
|
|
6
6
|
* Audio with plugins like [signalk-audio-notifications](https://github.com/meri-imperiumi/signalk-audio-notifications) and an attached speaker
|
|
7
7
|
* Meshtastic message with [signalk-meshtastic](https://github.com/meri-imperiumi/signalk-meshtastic)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meri-imperiumi/signalk-mob-notifier",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Create Signal K notifications for discovered AIS MOB and SART beacons",
|
|
3
|
+
"version": "1.0.3",
|
|
4
|
+
"description": "Create Signal K notifications for discovered AIS MOB, EPIRB, and SART beacons",
|
|
5
5
|
"main": "plugin/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "eslint ."
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"keywords": [
|
|
14
14
|
"signalk-node-server-plugin",
|
|
15
|
-
"signalk-category-
|
|
15
|
+
"signalk-category-notifications"
|
|
16
16
|
],
|
|
17
17
|
"author": "Henri Bergius <henri.bergius@iki.fi>",
|
|
18
18
|
"license": "MIT",
|
package/plugin/index.js
CHANGED
|
@@ -38,12 +38,12 @@ module.exports = (app) => {
|
|
|
38
38
|
const notified = [];
|
|
39
39
|
plugin.id = 'signalk-mob-notifier';
|
|
40
40
|
plugin.name = 'MOB Beacon Notifier';
|
|
41
|
-
plugin.description = 'Create notifications for discovered AIS MOB and SART beacons';
|
|
41
|
+
plugin.description = 'Create notifications for discovered AIS MOB, EPIRB, and SART beacons';
|
|
42
42
|
|
|
43
43
|
plugin.start = (settings) => {
|
|
44
44
|
interval = setInterval(() => {
|
|
45
45
|
// Check context for MOBs
|
|
46
|
-
const mobs = Object.keys(app.signalk.vessels)
|
|
46
|
+
const mobs = Object.keys(app.signalk.root.vessels)
|
|
47
47
|
.filter((context) => {
|
|
48
48
|
const mmsi = context.split(':').at(-1);
|
|
49
49
|
if (mmsi.indexOf('972') === 0) {
|
|
@@ -91,7 +91,7 @@ module.exports = (app) => {
|
|
|
91
91
|
notified.splice(notified.indexOf(mmsi), 1);
|
|
92
92
|
});
|
|
93
93
|
|
|
94
|
-
app.setPluginStatus(`${mobs.length} MOB or SART beacons detected`);
|
|
94
|
+
app.setPluginStatus(`${mobs.length} MOB, EPIRB, or SART beacons detected`);
|
|
95
95
|
|
|
96
96
|
if (mobs.length === 0) {
|
|
97
97
|
return;
|
|
@@ -156,7 +156,7 @@ module.exports = (app) => {
|
|
|
156
156
|
interval: {
|
|
157
157
|
type: 'integer',
|
|
158
158
|
default: 5,
|
|
159
|
-
title: 'How often to check for
|
|
159
|
+
title: 'How often to check for Beacons (in seconds)?',
|
|
160
160
|
},
|
|
161
161
|
},
|
|
162
162
|
};
|