Python homeassistant.const.ATTR_TEMPERATURE Examples

The following are 6 code examples of homeassistant.const.ATTR_TEMPERATURE(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module homeassistant.const , or try the search function .
Example #1
Source File: climate.py    From wiserHomeAssistantPlatform with MIT License 6 votes vote down vote up
def async_set_temperature(self, **kwargs):
        """Set new target temperatures."""
        target_temperature = kwargs.get(ATTR_TEMPERATURE)
        if target_temperature is None:
            return False

        _LOGGER.info("Setting temperature for %s to %s", self.name, target_temperature)

        await self.hass.async_add_executor_job(
            partial(
                self.data.wiserhub.setRoomTemperature, self.room_id, target_temperature,
            )
        )
        self._force_update = True
        await self.async_update_ha_state(True)

        return True 
Example #2
Source File: climate.py    From Heatmiser-for-home-assistant with GNU General Public License v2.0 5 votes vote down vote up
def set_temperature(self, **kwargs):
        """ Set new target temperature. """
        response = self.json_request({"SET_TEMP": [int(kwargs.get(ATTR_TEMPERATURE)), self._name]})
        if response:
            _LOGGER.info("set_temperature response: %s " % response)
            # Need check for success here
            # {'result': 'temperature was set'} 
Example #3
Source File: climate.py    From xknx with MIT License 5 votes vote down vote up
def async_set_temperature(self, **kwargs) -> None:
        """Set new target temperature."""
        temperature = kwargs.get(ATTR_TEMPERATURE)
        if temperature is None:
            return
        await self.device.set_target_temperature(temperature)
        self.async_write_ha_state() 
Example #4
Source File: climate.py    From homeassistant-zigate with MIT License 5 votes vote down vote up
def set_temperature(self, **kwargs):
        """Set new target temperatures."""
        if kwargs.get(ATTR_TEMPERATURE) is not None:
            temp = int(kwargs.get(ATTR_TEMPERATURE) * 100)
            if self.preset_mode == 'away':
                attr = 0x0014
            else:
                attr = 0x0012
            self.hass.data[ZIGATE_DOMAIN].write_attribute_request(self._device.addr,
                                                                  self._endpoint,
                                                                  0x0201,
                                                                  [(attr, 0x29, temp)])
        self.schedule_update_ha_state() 
Example #5
Source File: climate.py    From homeassistant-volkswagencarnet with Apache License 2.0 5 votes vote down vote up
def async_set_temperature(self, **kwargs):
        """Set new target temperatures."""
        _LOGGER.debug("Setting temperature for: %s", self.instrument.attr)
        temperature = kwargs.get(ATTR_TEMPERATURE)
        if temperature:
            await self.instrument.set_temperature(temperature) 
Example #6
Source File: midea.py    From midea-ac-py with MIT License 5 votes vote down vote up
def async_set_temperature(self, **kwargs):
        """Set new target temperatures."""
        if kwargs.get(ATTR_TEMPERATURE) is not None:
            self._device.target_temperature = int(kwargs.get(ATTR_TEMPERATURE))
            self._changed = True
            self.async_schedule_update_ha_state()