-
-
Save yasudacloud/9aa5206c65e49fb461cad53f2319b3ba to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncio | |
| from bleak import BleakScanner | |
| service_uuid = "0000fd81-0000-1000-8000-00805f9b34fb" | |
| async def main(): | |
| devices = await BleakScanner.discover( | |
| return_adv=True, | |
| service_uuids=[service_uuid], | |
| ) | |
| for device, ad in devices.values(): | |
| m_data = ad.manufacturer_data.get(0x055A) | |
| if m_data is None: | |
| raise RuntimeError("Manufacturer data for device not found.") | |
| print("-- Manufacturer data --") | |
| print(m_data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment