chadsmith/node-liftmaster — pull request #1 by mrose17 (2014-07-28 00:39:48+00:00)
Title: update to reflect the "latest unofficial" protocol

i have reviewed the other packages by:

- @adamheinmiller - https://github.com/adamheinmiller/ST_MyQ
- @pfeffed - https://github.com/pfeffed/liftmaster_myq

and then updated this package to reflect a “best hits” approach.

the changes:
1 headers: send User-Agent using brand from login response
2. parameters: use latest appId: and always send filterOn:
3. responses: look at both body.Message and body.ErrorMessage for error
messages
4. make sure logged in before attempting to retrieve devices, et. al.
5. keep track of longevity of security token, refreshing as needed
6. use latest paths (all lower-case, slightly different paths)
7. and the big one:

the return value on getDevices is flattened tree structure. first,
identify locations that are associated with gateways; then, identify
subordinate devices that are associated with garage doors.

note that in some cases “bogus” devices are returned (probably due to
incomplete registrations). in order to cull these, the
deviceRecord.response attribute, if present, is consulted to see if a
device is actually extant.