python-ember-mug icon indicating copy to clipboard operation
python-ember-mug copied to clipboard

Add macOS support

Open barak-obama opened this issue 2 years ago • 3 comments

  • Python Ember Mug version: 1.0.0
  • Python version: 3.11.6
  • Operating System: macOS 14.2.1 (23C71)

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/[email protected]/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/[email protected]/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/[email protected]/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)

barak-obama avatar Mar 10 '24 13:03 barak-obama

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

sopelj avatar Mar 10 '24 16:03 sopelj

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.

barak-obama avatar Mar 11 '24 12:03 barak-obama

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.

sopelj avatar Mar 11 '24 16:03 sopelj