@meri-imperiumi/signalk-mob-notifier 1.1.2 → 1.1.5
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 +6 -0
- package/package.json +1 -1
- package/plugin/index.js +7 -6
|
@@ -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,12 @@ Please note that this plugin aims to aid with noticing and locating crew overboa
|
|
|
11
11
|
|
|
12
12
|
## Changes
|
|
13
13
|
|
|
14
|
+
* 1.1.5 (2025-11-15)
|
|
15
|
+
- Bump release
|
|
16
|
+
* 1.1.4 (2025-11-12)
|
|
17
|
+
- Fix reading MOB vessel data structure
|
|
18
|
+
* 1.1.3 (2025-11-02)
|
|
19
|
+
- Fix detection of beacon type (MOB/SART/EPIRB)
|
|
14
20
|
* 1.1.2 (2025-11-01)
|
|
15
21
|
- Better approach at getting MOB coordinates
|
|
16
22
|
* 1.1.1 (2025-09-18)
|
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;
|
|
@@ -103,10 +103,10 @@ module.exports = (app) => {
|
|
|
103
103
|
return;
|
|
104
104
|
}
|
|
105
105
|
let message = 'Crew Overboard Beacon detected';
|
|
106
|
-
if (mmsi.indexOf('970') === 0) {
|
|
106
|
+
if (String(mmsi).indexOf('970') === 0) {
|
|
107
107
|
message = 'Search and Rescue Transponder Beacon detected';
|
|
108
108
|
}
|
|
109
|
-
if (mmsi.indexOf('974') === 0) {
|
|
109
|
+
if (String(mmsi).indexOf('974') === 0) {
|
|
110
110
|
message = 'Emergency Position Indicating Beacon detected';
|
|
111
111
|
}
|
|
112
112
|
// For each MOB get direction and range
|
|
@@ -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
|