File tree 1 file changed +8
-9
lines changed
custom_components/ble_monitor/ble_parser
1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -107,15 +107,14 @@ async def get_beacon_key(mac, product_id):
107
107
# (use 'python service_explorer.py --address <MAC> --service fe95' to dump the 'Xiaomi Inc.' service)
108
108
for service in client .services :
109
109
for char in service .characteristics :
110
- match char .description :
111
- case 'token' :
112
- HANDLE_AUTH = char .handle
113
- case 'Version' :
114
- HANDLE_FIRMWARE_VERSION = char .handle
115
- case 'Authentication' :
116
- HANDLE_AUTH_INIT = char .handle
117
- case 'beacon_key' :
118
- HANDLE_BEACON_KEY = char .handle
110
+ if (char .description == 'token' ):
111
+ HANDLE_AUTH = char .handle
112
+ elif (char .description == 'Version' ):
113
+ HANDLE_FIRMWARE_VERSION = char .handle
114
+ elif (char .description == 'Authentication' ):
115
+ HANDLE_AUTH_INIT = char .handle
116
+ elif (char .description == 'beacon_key' ):
117
+ HANDLE_BEACON_KEY = char .handle
119
118
120
119
# An asyncio future object is needed for callback handling
121
120
future = asyncio .get_event_loop ().create_future ()
You can’t perform that action at this time.
0 commit comments