Retrieves a thermostat state object by its assigned name

        :param name: The name of the thermostat state
        :return: The thermostat state object

def get_thermostat_state_by_name(self, name):
        """Retrieves a thermostat state object by its assigned name

        :param name: The name of the thermostat state
        :return: The thermostat state object
        """
        self._validate_thermostat_state_name(name)
        return next((state for state in self.thermostat_states
                     if state.name.lower() == name.lower()), None)