當前位置: 首頁>>代碼示例>>Python>>正文


Python const.ATTR_TEMPERATURE屬性代碼示例

本文整理匯總了Python中homeassistant.const.ATTR_TEMPERATURE屬性的典型用法代碼示例。如果您正苦於以下問題:Python const.ATTR_TEMPERATURE屬性的具體用法?Python const.ATTR_TEMPERATURE怎麽用?Python const.ATTR_TEMPERATURE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在homeassistant.const的用法示例。


在下文中一共展示了const.ATTR_TEMPERATURE屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: async_set_temperature

# 需要導入模塊: from homeassistant import const [as 別名]
# 或者: from homeassistant.const import ATTR_TEMPERATURE [as 別名]
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 
開發者ID:asantaga,項目名稱:wiserHomeAssistantPlatform,代碼行數:19,代碼來源:climate.py

示例2: set_temperature

# 需要導入模塊: from homeassistant import const [as 別名]
# 或者: from homeassistant.const import ATTR_TEMPERATURE [as 別名]
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'} 
開發者ID:MindrustUK,項目名稱:Heatmiser-for-home-assistant,代碼行數:9,代碼來源:climate.py

示例3: async_set_temperature

# 需要導入模塊: from homeassistant import const [as 別名]
# 或者: from homeassistant.const import ATTR_TEMPERATURE [as 別名]
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() 
開發者ID:XKNX,項目名稱:xknx,代碼行數:9,代碼來源:climate.py

示例4: set_temperature

# 需要導入模塊: from homeassistant import const [as 別名]
# 或者: from homeassistant.const import ATTR_TEMPERATURE [as 別名]
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() 
開發者ID:doudz,項目名稱:homeassistant-zigate,代碼行數:15,代碼來源:climate.py

示例5: async_set_temperature

# 需要導入模塊: from homeassistant import const [as 別名]
# 或者: from homeassistant.const import ATTR_TEMPERATURE [as 別名]
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) 
開發者ID:robinostlund,項目名稱:homeassistant-volkswagencarnet,代碼行數:8,代碼來源:climate.py

示例6: async_set_temperature

# 需要導入模塊: from homeassistant import const [as 別名]
# 或者: from homeassistant.const import ATTR_TEMPERATURE [as 別名]
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() 
開發者ID:NeoAcheron,項目名稱:midea-ac-py,代碼行數:8,代碼來源:midea.py


注:本文中的homeassistant.const.ATTR_TEMPERATURE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。