Closed vangorra closed 4 years ago
This looks very sensible to me - any other comments before I merge?
Will there be a corresponding update to the docs to clarify how subscribing to multiple controllers works?
And thanks @vangorra for working on this code. Sure good to see it get some attention!
BTW - has anyone been following discussions at the Vera developers forum about a complete rewrite of the Vera controller Linux firmware? It's long overdue, but having backward compatibility with plugins and API is not planned for the first release, if ever. Feedback there is welcome, especially as it relates to HA integration and the API.
While I'd prefer to eliminate the singleton altogether, I realize that will break other dependent projects, alas it must stay. Hence my compromise PR.
I don't think the docs need an update. This change adds expected behavior to the class structure. It's the get_cotroller() call in SubscriptionRegistry that's unusual and seeds confusion when trying to use a different controller.
Now released as 0.3.5
. Thanks for the contribution.
I've just rebuilt my dev machine - and can't currently test integration with Home Assistant - so can someone do this before putting together a PR for HA?
I've confirmed 0.3.5
is working with home assistant.
Fantastic - thanks very much @vangorra Are you happy to do the HA PR or would you like me to?
I'll do the PR. I want to remove HA's use of get_controller anyway. That will get us closer to supporting more than one controller in HA.
Perfect - thanks!
Making code run in less of a singleton way by allowing a subscription to use an instance of a controller. Fixing tests as they were broken.