本文整理汇总了Python中homeassistant.components.verisure.HUB.get方法的典型用法代码示例。如果您正苦于以下问题:Python HUB.get方法的具体用法?Python HUB.get怎么用?Python HUB.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类homeassistant.components.verisure.HUB
的用法示例。
在下文中一共展示了HUB.get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setup_platform
# 需要导入模块: from homeassistant.components.verisure import HUB [as 别名]
# 或者: from homeassistant.components.verisure.HUB import get [as 别名]
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Verisure switch platform."""
if not int(hub.config.get(CONF_SMARTPLUGS, 1)):
return False
hub.update_overview()
switches = []
switches.extend([
VerisureSmartplug(device_label)
for device_label in hub.get('$.smartPlugs[*].deviceLabel')])
add_entities(switches)
示例2: setup_platform
# 需要导入模块: from homeassistant.components.verisure import HUB [as 别名]
# 或者: from homeassistant.components.verisure.HUB import get [as 别名]
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Verisure lock platform."""
locks = []
if int(hub.config.get(CONF_LOCKS, 1)):
hub.update_overview()
locks.extend([
VerisureDoorlock(device_label)
for device_label in hub.get(
"$.doorLockStatusList[*].deviceLabel")])
add_entities(locks)
示例3: setup_platform
# 需要导入模块: from homeassistant.components.verisure import HUB [as 别名]
# 或者: from homeassistant.components.verisure.HUB import get [as 别名]
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Verisure Camera."""
if not int(hub.config.get(CONF_SMARTCAM, 1)):
return False
directory_path = hass.config.config_dir
if not os.access(directory_path, os.R_OK):
_LOGGER.error("file path %s is not readable", directory_path)
return False
hub.update_overview()
smartcams = []
smartcams.extend([
VerisureSmartcam(hass, device_label, directory_path)
for device_label in hub.get(
"$.customerImageCameras[*].deviceLabel")])
add_entities(smartcams)