Closed elockman closed 1 year ago
That would be a bug in the code. As a temporary fix, you can patch it with:
tstatdev = Contrib.ThermostatDevice( '{dev_id}', '192.168.1.100', '{key}' )
def setsetpoint_fixed( self, setpoint, cf=None ):
if self.mode == 'cool':
return self.setCoolSetpoint( setpoint, cf )
elif self.mode == 'heat' or self.mode == 'emergencyheat':
return self.setHeatSetpoint( setpoint, cf )
else:
# no idea, let the thermostat figure it out
return self.setMiddleSetpoint( setpoint, cf )
tstatdev.setSetpoint = setsetpoint_fixed
tstatdev.setSetpoint(72, 'f')
should then work. I'll try to get an update that fixes this pushed soon.
@uzlonewolf thank you for the quick response (and patch). I guess it makes sense that the setpoints are mode related.
I am communicating with a thermostat locally, but get an error when trying to set integer values.
This is a link to the thermostat on Amazon:
devices.json reveals:
setMiddleSetpoint() works, but setSetpoint() gives the following error:
Below is my full code(dev_id and key redacted). It is written and called from the examples folder. All of the commented lines provide similar errors.
Is there a bug in the code, or am I doing something wrong here?