bryan-bartow / homebridge-alarm.com

Alarm.com plugin for Homebridge
ISC License
43 stars 11 forks source link

Refactor as a Platform #11

Closed yungsters closed 8 years ago

yungsters commented 8 years ago

Refactors the Alarm.com Homebridge plugin to expose a platform instead of a single accessor, as proposed in #10. Currently, the platform only exposes a single security system accessory and behaves almost the same as before. However, this sets the stage for implementing accessories for other integrations supported by Alarm.com.

As far as behavior changes, this pull request removes some of the verbose logging for logic that is — at this point — pretty reliable and unnecessary. I've abstracted the WrapAPI request logic so that it can be used by all of the accessories (and not only the security system). This also helped me realize that a good future enhancement would be to reuse sessionUrl tokens whenever possible, which will improve responsiveness of commands.

yungsters commented 8 years ago

I forgot to mention... since this changes the UUIDs associated with the former accessory, this is a breaking change in two ways:

bryanbartow commented 8 years ago

@yungsters Thanks for doing this. I, too, had considered reusing the sessionUrl. I'll add that to the list. I'm going to merge this in. I added you as a collaborator, if you're so inclined.