Skip to content

Instantly share code, notes, and snippets.

@ch-world
Created June 29, 2017 16:03
Show Gist options
  • Save ch-world/dde4ace1896712cc30bfaf26f12257f3 to your computer and use it in GitHub Desktop.
Save ch-world/dde4ace1896712cc30bfaf26f12257f3 to your computer and use it in GitHub Desktop.
class IPThermostatWall(HMThermostat, HelperLowBatIP, AreaThermostatIP):
def __init__(self, device_description, proxy, resolveparamsets=False):
super().__init__(device_description, proxy, resolveparamsets)
# init metadata
self.SENSORNODE.update({"ACTUAL_TEMPERATURE": [1]})
self.WRITENODE.update({"SET_POINT_TEMPERATURE": [1]})
self.ACTIONNODE.update({"BOOST_MODE": [1]})
self.ATTRIBUTENODE.update({"LOW_BAT": [0],
"CONTROL_MODE": [1]})
def get_set_temperature(self):
""" Returns the current target temperature. """
return self.getWriteData("SET_POINT_TEMPERATURE")
def set_temperature(self, target_temperature):
""" Set the target temperature. """
try:
target_temperature = float(target_temperature)
except Exception as err:
LOG.debug("Thermostat.set_temperature: Exception %s" % (err,))
return False
self.writeNodeData("SET_POINT_TEMPERATURE", target_temperature)
def turnoff(self):
""" Turn off Thermostat. """
self.writeNodeData("SET_POINT_TEMPERATURE", self.OFF_VALUE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment