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).
This commit is contained in:
2022-04-15 16:17:18 -05:00
parent de8bba63a0
commit e0136a01cd
3 changed files with 6 additions and 6 deletions

View File

@ -181,8 +181,8 @@ describe('SLMessage utilities', function() {
assert.equal(decodedMsg.readUInt16LE(), 2021);
// javascript Date() month is 0-based, ScreenLogic month matches the calendar
assert.equal(decodedMsg.readUInt16LE(), 9);
// ScreenLogic day-of-week starts with Monday as 0
assert.equal(decodedMsg.readUInt16LE(), 0);
// ScreenLogic day-of-week starts with Sunday as 1
assert.equal(decodedMsg.readUInt16LE(), 2);
assert.equal(decodedMsg.readUInt16LE(), 6);
assert.equal(decodedMsg.readUInt16LE(), 22);
assert.equal(decodedMsg.readUInt16LE(), 8);