fix: Make D-Bus agent methods async to resolve pairing issue
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
10
main.py
10
main.py
@@ -54,16 +54,16 @@ class Agent(ServiceInterface):
|
|||||||
logging.info(f"DisplayPinCode for {device}: {pincode}")
|
logging.info(f"DisplayPinCode for {device}: {pincode}")
|
||||||
|
|
||||||
@method()
|
@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}")
|
logging.info(f"RequestConfirmation for {device} with passkey {passkey}")
|
||||||
# Automatically confirm and trust
|
# Automatically confirm and trust
|
||||||
loop = asyncio.get_event_loop()
|
asyncio.create_task(trust_and_connect_device(device))
|
||||||
loop.create_task(trust_and_connect_device(device))
|
|
||||||
|
|
||||||
@method()
|
@method()
|
||||||
def RequestAuthorization(self, device: 'o'):
|
async def RequestAuthorization(self, device: 'o'):
|
||||||
logging.info(f"RequestAuthorization for {device}")
|
logging.info(f"RequestAuthorization for {device}")
|
||||||
pass
|
# Automatically authorize and trust
|
||||||
|
asyncio.create_task(trust_and_connect_device(device))
|
||||||
|
|
||||||
@method()
|
@method()
|
||||||
def AuthorizeService(self, device: 'o', uuid: 's'):
|
def AuthorizeService(self, device: 'o', uuid: 's'):
|
||||||
|
|||||||
Reference in New Issue
Block a user