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}")
|
||||
|
||||
@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'):
|
||||
|
||||
Reference in New Issue
Block a user