@meri-imperiumi/signalk-mob-notifier 1.1.0 → 1.1.1
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 +2 -0
- package/package.json +2 -1
- package/plugin/index.js +7 -3
package/README.md
CHANGED
|
@@ -11,6 +11,8 @@ Please note that this plugin aims to aid with noticing and locating crew overboa
|
|
|
11
11
|
|
|
12
12
|
## Changes
|
|
13
13
|
|
|
14
|
+
* 1.1.1 (2025-09-18)
|
|
15
|
+
- Notifications include position when available
|
|
14
16
|
* 1.1.0 (2025-09-04)
|
|
15
17
|
- Notification is not re-published if it already exists
|
|
16
18
|
* 1.0.0 (2025-08-25)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meri-imperiumi/signalk-mob-notifier",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Create Signal K notifications for discovered AIS MOB, EPIRB, and SART beacons",
|
|
5
5
|
"main": "plugin/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"keywords": [
|
|
14
14
|
"signalk-node-server-plugin",
|
|
15
|
+
"signalk-category-ais",
|
|
15
16
|
"signalk-category-notifications"
|
|
16
17
|
],
|
|
17
18
|
"author": "Henri Bergius <henri.bergius@iki.fi>",
|
package/plugin/index.js
CHANGED
|
@@ -112,9 +112,9 @@ module.exports = (app) => {
|
|
|
112
112
|
// For each MOB get direction and range
|
|
113
113
|
const ownPosition = app.getSelfPath('navigation.position');
|
|
114
114
|
const mobPosition = app.getPath(`vessels.urn:mrn:imo:mmsi:${mmsi}.navigation.position`);
|
|
115
|
-
if (ownPosition && mobPosition) {
|
|
116
|
-
const me = new Point(ownPosition.latitude, ownPosition.longitude);
|
|
117
|
-
const they = new Point(mobPosition.latitude, mobPosition.longitude);
|
|
115
|
+
if (ownPosition && ownPosition.value && mobPosition && mobPosition.value) {
|
|
116
|
+
const me = new Point(ownPosition.value.latitude, ownPosition.value.longitude);
|
|
117
|
+
const they = new Point(mobPosition.value.latitude, mobPosition.value.longitude);
|
|
118
118
|
const distance = me.distanceTo(they, 'K') * 1000; // In meters
|
|
119
119
|
const direction = longDirection(me.directionTo(they));
|
|
120
120
|
message = `${message} ${distance} meters to ${direction}`;
|
|
@@ -134,6 +134,10 @@ module.exports = (app) => {
|
|
|
134
134
|
path: `notifications.mob.${mmsi}`,
|
|
135
135
|
value: {
|
|
136
136
|
message,
|
|
137
|
+
position: mobPosition ? mobPosition.value : null,
|
|
138
|
+
data: {
|
|
139
|
+
mmsi,
|
|
140
|
+
},
|
|
137
141
|
state: 'emergency',
|
|
138
142
|
method: ['visual', 'sound'],
|
|
139
143
|
},
|