@meri-imperiumi/signalk-mob-notifier 1.1.3 → 1.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/.github/workflows/publish.yml +4 -4
- package/README.md +7 -0
- package/package.json +1 -1
- package/plugin/index.js +8 -7
|
@@ -9,8 +9,8 @@ jobs:
|
|
|
9
9
|
build:
|
|
10
10
|
runs-on: ubuntu-latest
|
|
11
11
|
steps:
|
|
12
|
-
- uses: actions/checkout@
|
|
13
|
-
- uses: actions/setup-node@
|
|
12
|
+
- uses: actions/checkout@v5
|
|
13
|
+
- uses: actions/setup-node@v6
|
|
14
14
|
with:
|
|
15
15
|
node-version: 22
|
|
16
16
|
- run: npm install
|
|
@@ -20,8 +20,8 @@ jobs:
|
|
|
20
20
|
needs: build
|
|
21
21
|
runs-on: ubuntu-latest
|
|
22
22
|
steps:
|
|
23
|
-
- uses: actions/checkout@
|
|
24
|
-
- uses: actions/setup-node@
|
|
23
|
+
- uses: actions/checkout@v5
|
|
24
|
+
- uses: actions/setup-node@v6
|
|
25
25
|
with:
|
|
26
26
|
node-version: 22
|
|
27
27
|
registry-url: https://registry.npmjs.org/
|
package/README.md
CHANGED
|
@@ -11,6 +11,13 @@ Please note that this plugin aims to aid with noticing and locating crew overboa
|
|
|
11
11
|
|
|
12
12
|
## Changes
|
|
13
13
|
|
|
14
|
+
* 1.1.6 (2026-01-20)
|
|
15
|
+
- Round distance to beacon with single decimal
|
|
16
|
+
- Use EPIRB and SART terms for shorter notifications
|
|
17
|
+
* 1.1.5 (2025-11-15)
|
|
18
|
+
- Bump release
|
|
19
|
+
* 1.1.4 (2025-11-12)
|
|
20
|
+
- Fix reading MOB vessel data structure
|
|
14
21
|
* 1.1.3 (2025-11-02)
|
|
15
22
|
- Fix detection of beacon type (MOB/SART/EPIRB)
|
|
16
23
|
* 1.1.2 (2025-11-01)
|
package/package.json
CHANGED
package/plugin/index.js
CHANGED
|
@@ -44,8 +44,8 @@ module.exports = (app) => {
|
|
|
44
44
|
interval = setInterval(() => {
|
|
45
45
|
// Check context for MOBs
|
|
46
46
|
const mobs = Object.keys(app.signalk.root.vessels)
|
|
47
|
-
.
|
|
48
|
-
|
|
47
|
+
.map((ctx) => ctx.split(':').at(-1))
|
|
48
|
+
.filter((mmsi) => {
|
|
49
49
|
if (mmsi.indexOf('972') === 0) {
|
|
50
50
|
// MOB beacon seen!
|
|
51
51
|
return true;
|
|
@@ -104,10 +104,10 @@ module.exports = (app) => {
|
|
|
104
104
|
}
|
|
105
105
|
let message = 'Crew Overboard Beacon detected';
|
|
106
106
|
if (String(mmsi).indexOf('970') === 0) {
|
|
107
|
-
message = '
|
|
107
|
+
message = 'SART beacon detected';
|
|
108
108
|
}
|
|
109
109
|
if (String(mmsi).indexOf('974') === 0) {
|
|
110
|
-
message = '
|
|
110
|
+
message = 'EPIRB detected';
|
|
111
111
|
}
|
|
112
112
|
// For each MOB get direction and range
|
|
113
113
|
const getCoordinates = (v) => {
|
|
@@ -120,9 +120,10 @@ module.exports = (app) => {
|
|
|
120
120
|
return {};
|
|
121
121
|
};
|
|
122
122
|
const ownPosition = getCoordinates(app.getSelfPath('navigation.position'));
|
|
123
|
-
const
|
|
123
|
+
const mobContext = `urn:mrn:imo:mmsi:${mmsi}`;
|
|
124
|
+
const mob = app.signalk.root.vessels[mobContext];
|
|
124
125
|
let mobPosition = {};
|
|
125
|
-
if (mob.navigation && mob.navigation.position) {
|
|
126
|
+
if (mob && mob.navigation && mob.navigation.position) {
|
|
126
127
|
mobPosition = getCoordinates(mob.navigation.position);
|
|
127
128
|
}
|
|
128
129
|
if (ownPosition
|
|
@@ -131,7 +132,7 @@ module.exports = (app) => {
|
|
|
131
132
|
&& Number.isFinite(mobPosition.latitude)) {
|
|
132
133
|
const me = new Point(ownPosition.latitude, ownPosition.longitude);
|
|
133
134
|
const they = new Point(mobPosition.latitude, mobPosition.longitude);
|
|
134
|
-
const distance = me.distanceTo(they, 'K') * 1000; // In meters
|
|
135
|
+
const distance = (me.distanceTo(they, 'K') * 1000).toFixed(1); // In meters
|
|
135
136
|
const direction = longDirection(me.directionTo(they));
|
|
136
137
|
message = `${message} ${distance} meters to ${direction}`;
|
|
137
138
|
}
|