Move zone properties to a class
Opened this issue · 3 comments
Whilst I am happy to maintain the client's current v1-compatible JSON output, I would like to expose the v3 API too.
To make the distinction more obvious to existing users, I propose adding classes to contain the properties and statuses of a zone, with obviously named properties on the classes (e.g. _has_room_sensor rather than has_Pir).
The current data property that returns the v1-compatible JSON can then be generated from the properties on these classes.
@GeoffAtHome Any chance you could take a look at the PR for this, please?
Only real comment is the naming of zoneclasses
. I am happy with zoneclasses
but would have thought zone-properties
may be more appropriate.
Like has_pir
has changed to has_room_sensor
.
Test names and comments more meaningful than before.
Other than these comment good work.
Only real comment is the naming of
zoneclasses
. I am happy withzoneclasses
but would have thoughtzone-properties
may be more appropriate.Like
has_pir
has changed tohas_room_sensor
.Test names and comments more meaningful than before.
Other than these comment good work.
So, I'm not a big fan of repetition in names, hence going with the folder name of zoneclasses and the class name of Property. Makes the import:
from geniushubclient.zoneclasses.properties import Properties
It feels like having zoneproperties in there is pretty redundant, no?