8 Commits

Author SHA1 Message Date
5a076241f0 Satisfy linter 2022-04-17 10:50:21 -05:00
c95c9f8ce5 Fix day-of-week handling again
Saturday isn't 0, it's 7.

Add tests to make sure this is working now and forever!
2022-04-17 10:47:45 -05:00
e0136a01cd Fix SLDateTime day-of-week calculation
Turns out we were offsetting the wrong direction. This offsets the correct way (verified against a Wireshark capture of the official app).
2022-04-15 16:17:18 -05:00
77b034ce57 Add reading of SLTimes 2022-04-15 14:55:26 -05:00
f271554d89 Add DateTime writing support to SLMessages
There may be some value in providing a read version of this as well, but
it is comprised of so many properties that I'm leaving that out for now.
If it becomes a need in the future, it will be straightforward to add.
2021-09-06 23:01:42 -05:00
89b8775ce3 Add support for specifying the sender id to each call
This parameter is optional, so compatibility shouldn't be affected. Each SLMessage can set its own sender ID which is present on the returned message. This allows callers to fire multiple requests at once, even of the same type, while being able to identify which response went with which request. If not specified, the default value is 0.

Also went ahead and documented some of the helper functions present on SLMessage (so, available on all message instances).

Finally, since I was in and messing with each message anyway, I simplified and removed some repeated code from each derived message and had it call into the super to take advantage of shared decoding functionality.

The lambdas ("arrow functions") in test functions were removed per advice from Mocha's documentation where the implicit `this` rebinding can apparently cause problems. This should probably have been its own commit, but, again, I was already in there messing with stuff, so...oh well.

Closes #43
2020-08-11 22:20:58 -05:00
6a1d31c224 Made eslint happy again 2020-03-04 21:58:13 -06:00
e24f49285c Added tests for some of the SLMessage utilities 2020-02-09 14:51:23 -06:00