<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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)