Informatic / py9b

Ninebot/Xiaomi electric scooter communication library
GNU General Public License v3.0
5 stars 1 forks source link

Thank you for the contribs but do you know how to fix this? #1

Closed HelaFaye closed 4 years ago

HelaFaye commented 4 years ago

I'm having an issue using your Bleak implementation in NineRiFt: '''File "/home/ark/NineRiFt-kivy/py9b/link/bleak.py", line 73, in _connect self._client = BleakClient(port[1], device=self.device) IndexError: string index out of range'''

I'm using it here: '''File "./main.py", line 55, in on_press=lambda x: fwupd.Flash(selfile.selection[0])) File "/home/ark/NineRiFt-kivy/fwupd.py", line 154, in Flash raise LinkOpenException'''

I'm not familiar with Bleak. Although I was meaning to implement it myself after I finish the able implementation, mine wouldn't have turned out as good.

HelaFaye commented 4 years ago

Oh, I found the issue: My scooter's name is Phoenix. Is there a way to discover via manufacturer specific data like this?: '''ninebot_identity = bytearray([ 0x4e, 0x42, 0x21, 0x00, 0x00, 0x00, 0x00, 0xDE # Ninebot Bluetooth ID 4E422100000000DE xiaomi_identity = bytearray([ 0x4e, 0x42, 0x21, 0x00, 0x00, 0x00, 0x00, 0xDF # Xiaomi Bluetooth ID 4E422100000000DF ])'''