当前位置: 首页>>代码示例>>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;未经允许,请勿转载。