SignalK / signalk-derived-data

Generates deltas for values derived from signalk values
Apache License 2.0
18 stars 32 forks source link

fix: retrieve depth.transducerToKeel in calculation, not at start-up #50

Closed fabdrol closed 4 years ago

fabdrol commented 4 years ago

This bug fix intends to fix issue https://github.com/SignalK/signalk-derived-data/issues/49

The change calculates depth.belowKeel using the current value for depth.transducerToKeel, rather than that value at server start-up. There are various cases where this value is not present at that time or changes later in time:

fabdrol commented 4 years ago

@sbender9 any thoughts?

sbender9 commented 4 years ago

I think this won't work if the values are in defaults.json, which was the initial intention.

Should be able to make it work both ways. Get them at startup and subscribe to them incase they change?

fabdrol commented 4 years ago

Sounds good, I'll edit

Edit: done. @sbender9 please review when convenient. I can test this on-board on Thursday

fabdrol commented 4 years ago

This problem is actually quite annoying on the boat, tbh. I now have to deactivate and reactivate the derived-data plugin every time I restart the server

fabdrol commented 4 years ago

Thanks @tkurki . Needs version bump and push to npm (@sbender)?

sbender9 commented 4 years ago

Published as v1.24.4