Skip to content

BleakError object is not subscriptable #21

@blackshoals

Description

@blackshoals

'poetry install python cli.py' runs and finds Melnor devices. Connection fails with:

~/Downloads/melnor-bluetooth-main$ poetry run python cli.py 58:93:D8:37:29:59 Found device: Device( battery=0 valves=( Valve(id=0|is_watering=False|manual_minutes=20|seconds_left=0) Valve(id=1|is_watering=False|manual_minutes=20|seconds_left=0) Valve(id=2|is_watering=False|manual_minutes=20|seconds_left=0) Valve(id=3|is_watering=False|manual_minutes=20|seconds_left=0) ) ) Connecting to: 58:93:D8:37:29:59 Failed to connect to: 58:93:D8:37:29:59 Traceback (most recent call last): File "/home/ian/Downloads/melnor-bluetooth-main/cli.py", line 88, in <module> asyncio.run(main()) File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete return future.result() File "/home/ian/Downloads/melnor-bluetooth-main/cli.py", line 42, in main await device.fetch_state() File "/home/ian/Downloads/melnor-bluetooth-main/melnor_bluetooth/device.py", line 215, in fetch_state self._battery = parse_battery_value(some_bytes) File "/home/ian/Downloads/melnor-bluetooth-main/melnor_bluetooth/parser/battery.py", line 4, in parse_battery_value if (bytes[0] & 255 == 238) and (bytes[1] & 255 == 238): TypeError: 'BleakError' object is not subscriptable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions