Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only one device available #26

Open
blackshoals opened this issue Jun 16, 2022 · 1 comment
Open

Only one device available #26

blackshoals opened this issue Jun 16, 2022 · 1 comment

Comments

@blackshoals
Copy link

When trying to run to a second device using a different MAC address the turn on script fails. The scanner seems to see all the available devices, but only connects to one.

Connecting to: 58:93:D8:3E:D2:DB Disconnected from: 58:93:D8:3E:D2:DB Failed to connect to: 58:93:D8:3E:D2:DB Traceback (most recent call last): File "/home/ian/Downloads/melnor-bluetooth/turnon1.py", line 17, in <module> asyncio.run(main()) File "/home/ian/anaconda3/lib/python3.9/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/home/ian/anaconda3/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete return future.result() File "/home/ian/Downloads/melnor-bluetooth/turnon1.py", line 12, in main device.zone2.is_watering = True; File "/home/ian/Downloads/melnor-bluetooth/melnor_bluetooth/device.py", line 304, in zone2 if self._valve_count > 1: AttributeError: 'Device' object has no attribute '_valve_count'

@vanstinator
Copy link
Owner

This admittedly isn't a well defined case. The primary consumer for this lib is Home Assistant and the state machine there handles separate instances of Device for me.

I'll be refactoring this library quite a bit to better support some new bluetooth best-practices in Home Assistant. That work will likely significantly change the outer loop for handling devices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants