* initial code to interpret valveDataArray
* Some additional comments on the valveDataArray decoding message
* Adds decodeSensorData, decodeValveData, decodeDelayData, decodeMiscData
* reverts unintended change to index.js
* Refactor / rename variables
- renamed variables to better describe their use
- created a helper function 'isValvePresent' to simplify code
- changed while loop to for loop
* - Fixes bug in decodeValveData where only last valve's data was returned
- renames some variables based on testing to more descriptive names
- add CIRCUIT_NAME_VALUE_MAP for fixed values that the system uses (determined by testing on my system)
* refactored decodeMiscData to simplify code
* - Changed CIRCUIT_NAME_VALUE_MAP to array of objects
- Refactored getCircuitByDeviceId
- Added getCircuitsMap as helper to getCircuitByDeviceId and as a utility function to help in UI development
* initial code to interpret valveDataArray
* Some additional comments on the valveDataArray decoding message
* Adds decodeSensorData, decodeValveData, decodeDelayData, decodeMiscData
* reverts unintended change to index.js
* Refactor / rename variables
- renamed variables to better describe their use
- created a helper function 'isValvePresent' to simplify code
- changed while loop to for loop
* added helper methods for decode/encode dayMask
* moved isBitSet to SLMessage.js as this method is needed for several message types
* Refactored reusable functions to SLMessage
I find these console logs valuable for development but don't want them on all the time for everyone. It's cumbersome to comment/uncomment them continually, so this package helps nicely. I generally don't like adding dependencies, but this one seems wildly popular and itself only has one dependency (and that dependencies doesn't depend on anything else). So it seems acceptable to use.
I also enabled these debug logs by default when running the example configuration from VSCode.
Personally I've never found value in keeping line lengths low and it just leads to code that's awkward to write and read. No sense in disabling this per-file.
* added GetPumpStatus / SetPumpFlow commands
* Updated README.md with GetPumpStatus / SetPumpFlow information
* rename `setPointType` to `isRPMs`
* renamed val0 to pumpType and val1 to isRunning
* added `unknown command` case
* fixed lint error
* Renamed unknown values to pumpUnknown1 and pumpUnknown2
* renamed 30 to unknownCommand
I am not documenting this in the readme just yet because I don't really know how to interpret the data provided, but it seems to be necessary if we want to be able to change pump speeds in the future or read any historical data about the equipment. I'm not sure how much I'm going to be able to figure out about these arrays since the data appears random to me at the moment, but perhaps others will be able to figure out what's in here.
This avoids unnecessary allocations/reallocations while decoding a message by pre-sizing the buffer to the amount we know it will require. I feel like there's probably a better way to handle this, but this works for now.
This just returns the extra amount needed to add onto the string/array.
Also fixed up writeSLArray() not adding slack like it should have been. This wasn't an issue previously because the only place that currently uses this function is the password feature which is a fixed 16byte length, so it was already aligned. An upcoming commit will be using this, however, so I needed the alignment to be correct.
Finally, the read/write string functions were doing unnecessary conditional checks so I removed them. skipWrite() already does nothing if you tell it to skip 0, and adding 0 to readOffset won't do anything, so neither conditional is necessary at this point.
I should probably turn the semi-colon linter off since I really dislike the semi-colons everywhere, but it's probably too late for that at this point in the project.