当前位置: 首页>>代码示例>>Python>>正文


Python HUB.update_locks方法代码示例

本文整理汇总了Python中homeassistant.components.verisure.HUB.update_locks方法的典型用法代码示例。如果您正苦于以下问题:Python HUB.update_locks方法的具体用法?Python HUB.update_locks怎么用?Python HUB.update_locks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在homeassistant.components.verisure.HUB的用法示例。


在下文中一共展示了HUB.update_locks方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setup_platform

# 需要导入模块: from homeassistant.components.verisure import HUB [as 别名]
# 或者: from homeassistant.components.verisure.HUB import update_locks [as 别名]
def setup_platform(hass, config, add_devices, discovery_info=None):
    """Setup the Verisure platform."""
    locks = []
    if int(hub.config.get("locks", "1")):
        hub.update_locks()
        locks.extend([VerisureDoorlock(device_id) for device_id in hub.lock_status.keys()])
    add_devices(locks)
开发者ID:rhooper,项目名称:home-assistant,代码行数:9,代码来源:verisure.py

示例2: update

# 需要导入模块: from homeassistant.components.verisure import HUB [as 别名]
# 或者: from homeassistant.components.verisure.HUB import update_locks [as 别名]
    def update(self):
        """Update lock status."""
        hub.update_locks()

        if hub.lock_status[self._id].status == "unlocked":
            self._state = STATE_UNLOCKED
        elif hub.lock_status[self._id].status == "locked":
            self._state = STATE_LOCKED
        elif hub.lock_status[self._id].status != "pending":
            _LOGGER.error("Unknown lock state %s", hub.lock_status[self._id].status)
开发者ID:rhooper,项目名称:home-assistant,代码行数:12,代码来源:verisure.py

示例3: update

# 需要导入模块: from homeassistant.components.verisure import HUB [as 别名]
# 或者: from homeassistant.components.verisure.HUB import update_locks [as 别名]
    def update(self):
        """Update lock status."""
        hub.update_locks()

        if hub.lock_status[self._id].status == 'unlocked':
            self._state = STATE_UNLOCKED
        elif hub.lock_status[self._id].status == 'locked':
            self._state = STATE_LOCKED
        elif hub.lock_status[self._id].status != 'pending':
            _LOGGER.error(
                "Unknown lock state %s", hub.lock_status[self._id].status)
        self._changed_by = hub.lock_status[self._id].name
开发者ID:compvter,项目名称:home-assistant,代码行数:14,代码来源:verisure.py

示例4: update

# 需要导入模块: from homeassistant.components.verisure import HUB [as 别名]
# 或者: from homeassistant.components.verisure.HUB import update_locks [as 别名]
    def update(self):
        """ Update lock status """
        hub.update_locks()

        if hub.lock_status[self._id].status == 'unlocked':
            self._state = STATE_UNLOCKED
        elif hub.lock_status[self._id].status == 'locked':
            self._state = STATE_LOCKED
        elif hub.lock_status[self._id].status != 'pending':
            _LOGGER.error(
                'Unknown lock state %s',
                hub.lock_status[self._id].status)
开发者ID:100dayproject,项目名称:home-assistant,代码行数:14,代码来源:verisure.py


注:本文中的homeassistant.components.verisure.HUB.update_locks方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。