manzanotti / geniushub-client

Python library to provide direct connectivity to Genius Hub.
MIT License
9 stars 5 forks source link

Move zone properties to a class #89

Open manzanotti opened 8 months ago

manzanotti commented 8 months ago

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.

manzanotti commented 8 months ago

@GeoffAtHome Any chance you could take a look at the PR for this, please?

GeoffAtHome commented 8 months ago

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.

manzanotti commented 7 months ago

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.

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?