本文整理汇总了Python中homeassistant.components.verisure.HUB.update_smartcam_imageseries方法的典型用法代码示例。如果您正苦于以下问题:Python HUB.update_smartcam_imageseries方法的具体用法?Python HUB.update_smartcam_imageseries怎么用?Python HUB.update_smartcam_imageseries使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类homeassistant.components.verisure.HUB
的用法示例。
在下文中一共展示了HUB.update_smartcam_imageseries方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: check_imagelist
# 需要导入模块: from homeassistant.components.verisure import HUB [as 别名]
# 或者: from homeassistant.components.verisure.HUB import update_smartcam_imageseries [as 别名]
def check_imagelist(self):
"""Check the contents of the image list."""
hub.update_smartcam_imageseries()
image_ids = hub.get_image_info(
"$.imageSeries[?(@.deviceLabel=='%s')].image[0].imageId",
self._device_label)
if not image_ids:
return
new_image_id = image_ids[0]
if new_image_id in ('-1', self._image_id):
_LOGGER.debug("The image is the same, or loading image_id")
return
_LOGGER.debug("Download new image %s", new_image_id)
new_image_path = os.path.join(
self._directory_path, '{}{}'.format(new_image_id, '.jpg'))
hub.session.download_image(
self._device_label, new_image_id, new_image_path)
_LOGGER.debug("Old image_id=%s", self._image_id)
self.delete_image(self)
self._image_id = new_image_id
self._image = new_image_path