forked from auracaster/bumble_mirror
Merge pull request #650 from google/gbg/gatt-adapter-typing
new GATT adapter classes with proper typing support
This commit is contained in:
@@ -514,14 +514,19 @@ async def run_assist(
|
||||
return
|
||||
|
||||
# Subscribe to and read the broadcast receive state characteristics
|
||||
def on_broadcast_receive_state_update(
|
||||
value: bass.BroadcastReceiveState, index: int
|
||||
) -> None:
|
||||
print(
|
||||
f"{color(f'Broadcast Receive State Update [{index}]:', 'green')} {value}"
|
||||
)
|
||||
|
||||
for i, broadcast_receive_state in enumerate(
|
||||
bass_client.broadcast_receive_states
|
||||
):
|
||||
try:
|
||||
await broadcast_receive_state.subscribe(
|
||||
lambda value, i=i: print(
|
||||
f"{color(f'Broadcast Receive State Update [{i}]:', 'green')} {value}"
|
||||
)
|
||||
functools.partial(on_broadcast_receive_state_update, index=i)
|
||||
)
|
||||
except core.ProtocolError as error:
|
||||
print(
|
||||
|
||||
@@ -234,7 +234,7 @@ class GattlinkNodeBridge(GattlinkL2capEndpoint, Device.Listener):
|
||||
Characteristic.WRITEABLE,
|
||||
CharacteristicValue(write=self.on_rx_write),
|
||||
)
|
||||
self.tx_characteristic = Characteristic(
|
||||
self.tx_characteristic: Characteristic[bytes] = Characteristic(
|
||||
GG_GATTLINK_TX_CHARACTERISTIC_UUID,
|
||||
Characteristic.Properties.NOTIFY,
|
||||
Characteristic.READABLE,
|
||||
|
||||
Reference in New Issue
Block a user