sopelj / python-ember-mug

Python Library to Interact with Ember Mugs
MIT License
25 stars 4 forks source link

Error with discovering mugs #62

Open barak-obama opened 4 months ago

barak-obama commented 4 months ago

Description

The software stopped working, probably due to changed in the Bleak Library. I have runned "ember-mug discover" and got an error.

ember-mug discover

Traceback (most recent call last):
  File "/opt/homebrew/bin/ember-mug", line 8, in <module>
    sys.exit(run_cli())
             ^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/ember_mug/cli/__init__.py", line 13, in run_cli
    asyncio.run(cli.run())
  File "/opt/homebrew/Cellar/python@3.11/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/ember_mug/cli/commands.py", line 257, in run
    await self._commands[args.command](args)
  File "/opt/homebrew/lib/python3.11/site-packages/ember_mug/cli/commands.py", line 64, in discover
    mugs = await discover_mugs(mac=args.mac)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/ember_mug/scanner.py", line 47, in discover_mugs
    return [
           ^
  File "/opt/homebrew/lib/python3.11/site-packages/ember_mug/scanner.py", line 49, in <listcomp>
    for (d, a) in scanner.discovered_devices_and_advertisement_data
        ^^^^^^
ValueError: too many values to unpack (expected 2)
sopelj commented 4 months ago

Oops, no, this is a mistake on my end. Sorry about that. Should be fixed in v1.0.1b1

barak-obama commented 3 months ago

I've downloaded v1.0.1b1 and lots of other stuff are broken, I suspect its AdvertisementData related. I've tried to poke around but its byonde my skill limit.

sopelj commented 3 months ago

Do you have any more information than that it's "broken"? I'd be happy to try and fix it, but I'd need more information. Such as the actual errors and what you are trying to do.

I did run this and the "discover" method now works fine for me, however. So, I'd be tempted to resolve this issue. I see that you are on macOS, so I think if you are running into issues it is likely that, that is the reason. If you would like to open issues for that I'd be happy to try and resolve them, however I do not have a Mac to test with.