warhammerkid / bluetti_mqtt

MQTT interface for Bluetti power stations
MIT License
139 stars 53 forks source link

bluetti-logger fails on EB3A when parsing pack_num_max result #13

Closed jretz closed 2 years ago

jretz commented 2 years ago

Running bluetti-logger on an EB3A results in the process failing with a traceback:

$ venv/bin/bluetti-logger --log eb3a.log xx:xx:xx:xx:xx:xx
Connecting to xx:xx:xx:xx:xx:xx
Waiting for connection...
Traceback (most recent call last):
  File "/home/jimmy/bluetti/venv/bin/bluetti-logger", line 8, in <module>
    sys.exit(main())
  File "/home/jimmy/bluetti_mqtt/bluetti_mqtt/logger_cli.py", line 117, in main
    asyncio.run(log(args.address, args.log))
  File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/home/jimmy/bluetti_mqtt/bluetti_mqtt/logger_cli.py", line 69, in log
    pack_max = device.parse(0x00, 0x5B, result[3:-2])['pack_num_max']
KeyError: 'pack_num_max'
warhammerkid commented 2 years ago

Thanks for fixing this!