fl4p / batmon-ha

Add-on for Home Assistant to connect JK, JBD, Daly, ANT, SOK and Supervolt BMS via Bluetooth
MIT License
293 stars 55 forks source link

Jk bms b2a24s20p error 'bleak.exc' has no attribute 'BleakDeviceNotFoundError' #167

Closed rdaguerre closed 2 months ago

rdaguerre commented 10 months ago
await self._connect_client(timeout=timeout)

File "/app/bmslib/bt.py", line 185, in _connect_client except bleak.exc.BleakDeviceNotFoundError as exc: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'bleak.exc' has no attribute 'BleakDeviceNotFoundError'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/app/bmslib/sampling.py", line 149, in call s = await self._sample_inner() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/bmslib/sampling.py", line 212, in _sample_inner async with bms: File "/app/bmslib/bt.py", line 343, in aenter await self.connect() File "/app/bmslib/models/jikong.py", line 128, in connect await self._connect_with_scanner(timeout=timeout) File "/app/bmslib/bt.py", line 266, in _connect_with_scanner raise bleak.exc.BleakDeviceNotFoundError( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'bleak.exc' has no attribute 'BleakDeviceNotFoundError'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/app/main.py", line 43, in fetch_loop if await fn(): ^^^^^^^^^^ File "/app/main.py", line 357, in fn raise exceptions[0] File "/app/main.py", line 352, in fn await t() File "/app/bmslib/sampling.py", line 153, in call except bleak.exc.BleakDeviceNotFoundError: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'bleak.exc' has no attribute 'BleakDeviceNotFoundError'

22:52:18 INFO [sampling] connecting bms JKBt(C8:47:8C:10:60:0B,bms_auto) 22:52:24 INFO [jikong] normal connect failed (module 'bleak.exc' has no attribute 'BleakDeviceNotFoundError'), connecting with scanner 22:52:34 INFO [sampling] connecting bms JKBt(C8:47:8C:10:83:85,bms0) 22:52:40 INFO [jikong] normal connect failed (module 'bleak.exc' has no attribute 'BleakDeviceNotFoundError'), connecting with scanner 22:52:50 ERROR [main] 2 exceptions occurred fetching BMSs 22:52:50 ERROR [main] Error (num 2, max 200) reading BMS: module 'bleak.exc' has no attribute 'BleakDeviceNotFoundError' 22:52:50 ERROR [main] Stack: Traceback (most recent call last): File "/app/bmslib/bt.py", line 184, in _connect_client await asyncio.wait_for(self.client.connect(timeout=timeout), timeout=timeout + 1) File "/usr/lib/python3.11/asyncio/tasks.py", line 489, in wait_for return fut.result() ^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/bleak/backends/bluezdbus/client.py", line 198, in connect raise BleakError( bleak.exc.BleakError: Device with address C8:47:8C:10:60:0B was not found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/app/bmslib/models/jikong.py", line 125, in connect await super().connect(timeout=6) File "/app/bmslib/bt.py", line 235, in connect await self._connect_client(timeout=timeout) File "/app/bmslib/bt.py", line 185, in _connect_client except bleak.exc.BleakDeviceNotFoundError as exc: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'bleak.exc' has no attribute 'BleakDeviceNotFoundError'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/app/bmslib/sampling.py", line 149, in call s = await self._sample_inner() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/bmslib/sampling.py", line 212, in _sample_inner async with bms: File "/app/bmslib/bt.py", line 343, in aenter await self.connect() File "/app/bmslib/models/jikong.py", line 128, in connect await self._connect_with_scanner(timeout=timeout) File "/app/bmslib/bt.py", line 266, in _connect_with_scanner raise bleak.exc.BleakDeviceNotFoundError( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'bleak.exc' has no attribute 'BleakDeviceNotFoundError'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/app/main.py", line 43, in fetch_loop if await fn(): ^^^^^^^^^^ File "/app/main.py", line 357, in fn raise exceptions[0] File "/app/main.py", line 352, in fn await t() File "/app/bmslib/sampling.py", line 153, in call except bleak.exc.BleakDeviceNotFoundError: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'bleak.exc' has no attribute 'BleakDeviceNotFoundError'

22:52:51 INFO [sampling] connecting bms JKBt(C8:47:8C:10:60:0B,bms_auto) 22:52:57 INFO [jikong] normal connect failed (module 'bleak.exc' has no attribute 'BleakDeviceNotFoundError'), connecting with scanner

fl4p commented 10 months ago

try to enable 'install_newer_bleak'

Am Di., 28. Nov. 2023 um 01:55 Uhr schrieb rdaguerre < @.***>:

await self._connect_client(timeout=timeout)

File "/app/bmslib/bt.py", line 185, in _connect_client except bleak.exc.BleakDeviceNotFoundError as exc: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'bleak.exc' has no attribute 'BleakDeviceNotFoundError'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/app/bmslib/sampling.py", line 149, in call s = await self._sample_inner() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/bmslib/sampling.py", line 212, in _sample_inner async with bms: File "/app/bmslib/bt.py", line 343, in aenter await self.connect() File "/app/bmslib/models/jikong.py", line 128, in connect await self._connect_with_scanner(timeout=timeout) File "/app/bmslib/bt.py", line 266, in _connect_with_scanner raise bleak.exc.BleakDeviceNotFoundError( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'bleak.exc' has no attribute 'BleakDeviceNotFoundError'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/app/main.py", line 43, in fetch_loop if await fn(): ^^^^^^^^^^ File "/app/main.py", line 357, in fn raise exceptions[0] File "/app/main.py", line 352, in fn await t() File "/app/bmslib/sampling.py", line 153, in call except bleak.exc.BleakDeviceNotFoundError: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'bleak.exc' has no attribute 'BleakDeviceNotFoundError'

22:52:18 INFO [sampling] connecting bms JKBt(C8:47:8C:10:60:0B,bms_auto) 22:52:24 INFO [jikong] normal connect failed (module 'bleak.exc' has no attribute 'BleakDeviceNotFoundError'), connecting with scanner 22:52:34 INFO [sampling] connecting bms JKBt(C8:47:8C:10:83:85,bms0) 22:52:40 INFO [jikong] normal connect failed (module 'bleak.exc' has no attribute 'BleakDeviceNotFoundError'), connecting with scanner 22:52:50 ERROR [main] 2 exceptions occurred fetching BMSs 22:52:50 ERROR [main] Error (num 2, max 200) reading BMS: module 'bleak.exc' has no attribute 'BleakDeviceNotFoundError' 22:52:50 ERROR [main] Stack: Traceback (most recent call last): File "/app/bmslib/bt.py", line 184, in _connect_client await asyncio.wait_for(self.client.connect(timeout=timeout), timeout=timeout + 1) File "/usr/lib/python3.11/asyncio/tasks.py", line 489, in wait_for return fut.result() ^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/bleak/backends/bluezdbus/client.py", line 198, in connect raise BleakError( bleak.exc.BleakError: Device with address C8:47:8C:10:60:0B was not found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/app/bmslib/models/jikong.py", line 125, in connect await super().connect(timeout=6) File "/app/bmslib/bt.py", line 235, in connect await self._connect_client(timeout=timeout) File "/app/bmslib/bt.py", line 185, in _connect_client except bleak.exc.BleakDeviceNotFoundError as exc: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'bleak.exc' has no attribute 'BleakDeviceNotFoundError'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/app/bmslib/sampling.py", line 149, in call s = await self._sample_inner() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/bmslib/sampling.py", line 212, in _sample_inner async with bms: File "/app/bmslib/bt.py", line 343, in aenter await self.connect() File "/app/bmslib/models/jikong.py", line 128, in connect await self._connect_with_scanner(timeout=timeout) File "/app/bmslib/bt.py", line 266, in _connect_with_scanner raise bleak.exc.BleakDeviceNotFoundError( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'bleak.exc' has no attribute 'BleakDeviceNotFoundError'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/app/main.py", line 43, in fetch_loop if await fn(): ^^^^^^^^^^ File "/app/main.py", line 357, in fn raise exceptions[0] File "/app/main.py", line 352, in fn await t() File "/app/bmslib/sampling.py", line 153, in call except bleak.exc.BleakDeviceNotFoundError: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'bleak.exc' has no attribute 'BleakDeviceNotFoundError'

22:52:51 INFO [sampling] connecting bms JKBt(C8:47:8C:10:60:0B,bms_auto) 22:52:57 INFO [jikong] normal connect failed (module 'bleak.exc' has no attribute 'BleakDeviceNotFoundError'), connecting with scanner

— Reply to this email directly, view it on GitHub https://github.com/fl4p/batmon-ha/issues/167, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUUUFVRQLTVMVEMGFRB2NTYGU77DAVCNFSM6AAAAAA7454N72VHI2DSMVQWIX3LMV43ASLTON2WKOZSGAYTGNBUGYYDSNQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>