maximvelichko / pyvera

A python library to control devices via the Vera hub
GNU General Public License v2.0
26 stars 31 forks source link

Added scene support #75

Closed alanfischer closed 6 years ago

alanfischer commented 7 years ago

This adds scene support

alanfischer commented 7 years ago

Closing this for now, I realized I need to expose a couple other items for a clean home-assistant integration...

alanfischer commented 7 years ago

Ok, this should be better...

pavoni commented 7 years ago

Looks good - duplicates some of the VeraDevice methods. What was the reason you decided to duplicate rather than inherit?

alanfischer commented 7 years ago

The api exposes the scenes separately from the devices: {"scenes":[{...},...], "devices":[{...},...]} And the scene ids are a separate set than the device ids, so scene ids overlap with device ids. If you would prefer I can certainly still use the VeraDevice & device_id members in there to store the scene items.

pavoni commented 7 years ago

Got it.

At some point might be worth factoring out the few shared methods (eg those that call a vera service etc) into a class that can be used by both devices and scenes.

But happy to merge anyway, it's a great addition as is.

Perhaps just add a comment to the code explaining why it isn't a device - and an issue to remind us to take another look at some point?

alanfischer commented 6 years ago

Ok, added some comments related to these

pavoni commented 6 years ago

Thanks for this - now released as 0.2.39