feat: add conversion formulas to active preset and bulk metadata endpoint #2436
feat: add conversion formulas to active preset and bulk metadata endpoint #2436motamman wants to merge 1 commit intoSignalK:masterfrom
Conversation
|
I think the additional details are useful in the active endpoint. In the use case where I want to display wind speed values in m/s when other speed values are in knots, how is this made available via the api? It appears that only the preset values are available. |
You mean an endpoint for all possible base-unit conversions? something like /signalk/v1/unitpreferences/definitions/?SI=K, which returns all possible conversions and formulas? We already have this /signalk/v1/unitpreferences/definitions (all base units and all conversions) BTW, there is an option to select the base units as the display units in the metadata editor, overriding the preset setting. |
|
I don't mean the calculation formula, but how does the client know that windspeed is a different target unit to that defined by the speed category by using the API? |
|
Forgive me, I am not sure I get why that might be useful. |
|
If windspeed is a sub category of speed, how do I see that config using the REST API. It's useful for clients that collect data from slow changing sources and then convert & display values on demand, as opposed to the "as received" like data browser or KIP. |
|
Sorry Adrian but I don't quite understand what you're after here, as the core categories don't have wind speed, just speed. So are we missing support for a use case: "I want wind speeds in m/s but other speeds in knots"? Or more specific one "I want x.y.z in some other unit than anyhing else". |
|
The docs contain the example of having windspeed in different units to the speed category (without specifying how to do this, I assume this is via Meta values in the data browser). |
Description:
Summary
from unit definitions for each category
flat path-keyed map with displayUnits resolved
/signalk/v1/api/vessels/self responses
Motivation
REST clients (like Freeboard-SK) previously had no single endpoint to get all paths with resolved
display unit preferences and conversion formulas. displayUnits was only available per-path or
via WebSocket sendMeta=all. These changes close that gap.