Skip to content

Commit

Permalink
0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lolouk44 committed Sep 18, 2022
1 parent e9ee719 commit b40619a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Xiaomi_Scale.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,8 @@ async def main(address, char_uuid):
await client.stop_notify(BODY_COMPOSITION_MEASUREMENT)
await client.disconnect()
except Exception as err:
if err.length() == 0 or err[0:23] == "[org.bluez.Error.Failed]" or err[0:18] == "Device with address":
if len(str(err)) == 0 or str(err)[0:24] == "[org.bluez.Error.Failed]" or str(err)[0:19] == "Device with address":
#sys.stdout.write(f"{datetime.now().strftime('%Y-%m-%d %H:%M:%S')} - Could Not Connect to Scale, Retrying...\n{err}\n")
await asyncio.sleep(10)
else:
sys.stdout.write(f"{datetime.now().strftime('%Y-%m-%d %H:%M:%S')} - Could Not Connect to Scale, Retrying...\n{err}\n")
Expand Down

0 comments on commit b40619a

Please sign in to comment.