Skip to main content

Module units

Module units 

Source
Expand description

Fetching a mariner’s own display units off the wire.

The read half only: signalk-server’s unitpreferences feature has an admin UI of its own for setting a preference, and nothing in this workspace has a use for writing one. [signalk::units] is what makes sense of the answer; this module only gets it there.

Confirmed against a real server: GET /signalk/v1/unitpreferences/active answers with no Authorization header at all, on a server with security on and allow_readonly: false – unlike own-ship data, this is treated as server-wide configuration rather than the vessel’s own information, so no token is threaded through here.

Functions§

fetch_active
Asks the server what it currently prefers, and reads as much of the answer as [signalk::units::Preferences::parse] recognises.