Closed sbender9 closed 8 years ago
Typo, lower check is >=
return value => value < zone.upper && value >= zone.lower
(1) The alarm method is already configurable (I commited it accidentaly when fixing the firing): https://github.com/SignalK/signalk-zones/blob/8236b985a72b58e3a0683df0960a3c1f145e0b1d/index.js#L70-L76 and this change would override that totally. If the method is hard coded to the state then it doesn't really play any role and should be removed from the schema. I suggest we forget this. How about a default value for it in the UI (plugin and WilhelmSK)?
(2) I do not think that silencing the notification should be part of this plugin's API, but we need to define the way to do it using the normal Signal K http api. You should be able to POST a new value to the method in the full model via HTTP and that should send a delta out to notify all clients of the change.
In fact this goes for the whole zones information - now this plugin and I assume WilhelmSK as well is using the plugin's API to modify the zones. This is not in any way part of the Signal K API. The way to do it would be to POST the zones json to the relevant path in the full model.
(3) I'll fix the lower condition separately.
OK?
All sounds good. We just need to make the plugin set the method value based on what's in the zone info, right?
Silencing is really just changing the notification method, right?
So when you silence the audible alarm (but leave visual on) you would POST ['visual']
to /signalk/v1/api/vessels/self/notifications/navigation/speedOverGround/method
.
Is this what you meant with your last comment?
No, but my comment was addressed with commit 2993ce7
Too lazy and tired to split these up into multiple pull requests.
Added [visual, sound] method to notifications Added ability to silence alarms Changes lower check to be <=, otherwise there will be values that don't fall in a zone