Nicnl / homebridge-minimal-http-blinds

GNU General Public License v3.0
12 stars 13 forks source link

Complete callbacks with errors #9

Closed KnicKnic closed 5 years ago

KnicKnic commented 5 years ago

Currently the code does not complete callbacks if there is an http error. The callbacks allow for setting an error code instead of null. This would then give an understanding to the user that they are receiving a bad value and not the current one.

You can see valid way of returning error codes in the sample. https://github.com/nfarina/homebridge/blob/6500912f54a70ff479e63e2b72760ab589fa558a/example-plugins/homebridge-lockitron/index.js#L75

Due to results getting cached, this would mean that errors should also get cached. Also this will fix returning uninitialized data.

KnicKnic commented 5 years ago

Closed due to merger of https://github.com/Nicnl/homebridge-minimal-http-blinds/pull/10