def set_hkr_state(self, state):
        """Set the state of the thermostat.

        Possible values for state are: 'on', 'off', 'comfort', 'eco'.
        """
        try:
            value = {
                'off': 0,
                'on': 100,
                'eco': self.eco_temperature,
                'comfort': self.comfort_temperature
            }[state]
        except KeyError:
            return

        self.set_target_temperature(value)
def set_hkr_state ( self , state ) : try : value = { 'off' : 0 , 'on' : 100 , 'eco' : self . eco_temperature , 'comfort' : self . comfort_temperature } [ state ] except KeyError : return self . set_target_temperature ( value )
Set the state of the thermostat.

        Possible values for state are: 'on', 'off', 'comfort', 'eco'.