示例#1
0
 async def create_subscription(target: str):
     sub = Subscription()
     sub.installed_app_id = installed_app_id
     sub.location_id = location_id
     sub.source_type = SourceType.CAPABILITY
     sub.capability = target
     try:
         await api.create_subscription(sub)
         _LOGGER.debug("Created subscription for '%s' under app '%s'",
                       target, installed_app_id)
     except Exception:  # pylint:disable=broad-except
         _LOGGER.exception("Failed to create subscription for '%s' under "
                           "app '%s'", target, installed_app_id)
示例#2
0
 def _factory(capability):
     sub = Subscription()
     sub.capability = capability
     return sub