@sailingnaturali/signalk-currents 0.2.0 → 0.3.0
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 +6 -1
- package/dist/routes.d.ts +2 -0
- package/dist/routes.js +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -99,7 +99,8 @@ ebb — fill them from a current atlas or pilot book for your stations.
|
|
|
99
99
|
|
|
100
100
|
### `/currents` resource
|
|
101
101
|
|
|
102
|
-
|
|
102
|
+
Served at `/signalk/v2/api/resources/currents` (anonymously readable under
|
|
103
|
+
`allow_readonly`):
|
|
103
104
|
|
|
104
105
|
```json
|
|
105
106
|
{
|
|
@@ -109,6 +110,8 @@ Mounted at `/plugins/signalk-currents/currents`:
|
|
|
109
110
|
"label": "Gillard Passage",
|
|
110
111
|
"lat": 50.3933,
|
|
111
112
|
"lon": -125.1567,
|
|
113
|
+
"floodDir": 160,
|
|
114
|
+
"ebbDir": 340,
|
|
112
115
|
"events": [
|
|
113
116
|
{ "utc": "2026-06-06T04:14:00.000Z", "kind": "slack", "speedKn": 0 },
|
|
114
117
|
{ "utc": "2026-06-06T05:40:00.000Z", "kind": "flood", "speedKn": 4.1 }
|
|
@@ -119,6 +122,8 @@ Mounted at `/plugins/signalk-currents/currents`:
|
|
|
119
122
|
```
|
|
120
123
|
|
|
121
124
|
`kind` is `slack` | `flood` | `ebb`; `speedKn` is the event speed magnitude in knots.
|
|
125
|
+
`floodDir` / `ebbDir` are the station's set directions in °true, straight from the
|
|
126
|
+
station config — so consumers can say which way the water flows, not just when it turns.
|
|
122
127
|
|
|
123
128
|
## Development
|
|
124
129
|
|
package/dist/routes.d.ts
CHANGED
package/dist/routes.js
CHANGED
|
@@ -7,7 +7,9 @@ function currentsPayload(series) {
|
|
|
7
7
|
return {
|
|
8
8
|
stations: [...series.values()].map(s => ({
|
|
9
9
|
stationId: s.station.stationId, label: s.station.label,
|
|
10
|
-
lat: s.station.lat, lon: s.station.lon,
|
|
10
|
+
lat: s.station.lat, lon: s.station.lon,
|
|
11
|
+
floodDir: s.station.floodDir, ebbDir: s.station.ebbDir,
|
|
12
|
+
events: s.events,
|
|
11
13
|
})),
|
|
12
14
|
};
|
|
13
15
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sailingnaturali/signalk-currents",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Publish CHS/NOAA tidal-current predictions to SignalK — environment.current + a /currents resource, for a configured station list.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|