robertmuth / PyZwaver

Z-Wave library written in Python3
GNU General Public License v3.0
38 stars 8 forks source link

Support thermostat setpoints #13

Closed tkintscher closed 5 years ago

tkintscher commented 5 years ago

The ThermostatSetpoint_Set command is currently not enabled.

I've added a solution that works by reusing _MakeSensor for it. The proposed patch would allow changing the setpoint like this:

node.BatchCommandSubmitFilteredSlow([ z.ThermostatSetpoint_Set, { 'thermo': 1, 'value': { 'exp': 2, 'unit': 0, '_value': 18.5 } } ])

The value, precision and unit are then transparently encoded into { 'value': { 'value': ... } } and sent.

robertmuth commented 5 years ago

I left a comment on the pull request - it looks fine but please update the tests to exercise the new code