diff --git a/main.py b/main.py index 51ea4bc..90d81e1 100644 --- a/main.py +++ b/main.py @@ -54,16 +54,16 @@ class Agent(ServiceInterface): logging.info(f"DisplayPinCode for {device}: {pincode}") @method() - def RequestConfirmation(self, device: 'o', passkey: 'u'): + async def RequestConfirmation(self, device: 'o', passkey: 'u'): logging.info(f"RequestConfirmation for {device} with passkey {passkey}") # Automatically confirm and trust - loop = asyncio.get_event_loop() - loop.create_task(trust_and_connect_device(device)) + asyncio.create_task(trust_and_connect_device(device)) @method() - def RequestAuthorization(self, device: 'o'): + async def RequestAuthorization(self, device: 'o'): logging.info(f"RequestAuthorization for {device}") - pass + # Automatically authorize and trust + asyncio.create_task(trust_and_connect_device(device)) @method() def AuthorizeService(self, device: 'o', uuid: 's'):