diff options
author | Edi Feschiyan <edi.feschiyan@konsulko.com> | 2020-05-14 12:32:59 +0300 |
---|---|---|
committer | Edi Feschiyan <edi.feschiyan@konsulko.com> | 2020-06-09 09:29:49 +0300 |
commit | 32540833af3e633880aa365284c72950da27fece (patch) | |
tree | 7f319fad0d79ad2c7a10baccd012ed58876da7c1 /bluetooth.py | |
parent | 219e992aa8a8e5a7db48cc9d66bb0ddbbe7c21a3 (diff) |
removing waitresponse, will be using *Service.response() to get a packet. trying to figure out async generator as a service listener. WIP
Diffstat (limited to 'bluetooth.py')
-rw-r--r-- | bluetooth.py | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/bluetooth.py b/bluetooth.py index a28bc3c..a4bbac3 100644 --- a/bluetooth.py +++ b/bluetooth.py @@ -13,41 +13,41 @@ class BluetoothService(AGLBaseService): def __init__(self, ip, port=None, service='agl-service-bluetooth'): super().__init__(api='Bluetooth-Manager', ip=ip, port=port, service=service) - async def subscribe(self, event='device_changes', waitresponse=False): + async def subscribe(self, event='device_changes'): await super().subscribe(event=event) - async def unsubscribe(self, event='device_changes', waitresponse=False): + async def unsubscribe(self, event='device_changes'): await super().unsubscribe(event=event) - async def managed_objects(self, waitresponse=False): - return await self.request('managed_objects', waitresponse=waitresponse) + async def managed_objects(self): + return await self.request('managed_objects') - async def adapter_state(self, adapter=None, value=None, waitresponse=False): + async def adapter_state(self, adapter=None, value=None): p = {} if adapter: p = {'adapter': adapter} if isinstance(value, dict): p = {**p, **value} - return await self.request('adapter_state', p, waitresponse=waitresponse) + return await self.request('adapter_state', p) - async def default_adapter(self, waitresponse=False): - return await self.request('default_adapter', "", waitresponse=waitresponse) + async def default_adapter(self): + return await self.request('default_adapter', "") - async def connect(self, device: str = 'hci0', waitresponse=False): - return await self.request('connect', {'device': device}, waitresponse=waitresponse) + async def connect(self, device: str = 'hci0'): + return await self.request('connect', {'device': device}) - async def disconnect(self, device: str = 'hci0', waitresponse=False): - return await self.request('disconnect', {'device': device}, waitresponse=waitresponse) + async def disconnect(self, device: str = 'hci0'): + return await self.request('disconnect', {'device': device}) - async def pair(self, device, waitresponse=False): - return await self.request('pair', {'device': device}, waitresponse=waitresponse) + async def pair(self, device): + return await self.request('pair', {'device': device}) - async def cancel_pairing(self, waitresponse=False): - return await self.request('cancel_pairing', waitresponse=waitresponse) + async def cancel_pairing(self): + return await self.request('cancel_pairing') - async def confirm_pairing(self, pincode, waitresponse=False): - return await self.request('confirm_pairing', {'pincode': pincode}, waitresponse=waitresponse) + async def confirm_pairing(self, pincode): + return await self.request('confirm_pairing', {'pincode': pincode}) async def avrcp_controls(self): pass |