本文整理汇总了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)
示例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)
示例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
示例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)