Skip to content

Instantly share code, notes, and snippets.

@iamatulsingh
Created April 19, 2020 09:17
Show Gist options
  • Save iamatulsingh/0f6260cd218177813903c9d9fb4433e1 to your computer and use it in GitHub Desktop.
Save iamatulsingh/0f6260cd218177813903c9d9fb4433e1 to your computer and use it in GitHub Desktop.
def battery_data(self):
self.battery_char = self.readCharacteristic(int(UUIDS.BATTERY_INFO_HND, 16))
self.battery_level = struct.unpack("<B", self.battery_char)[0]
self._log.info(f"Battery Level: {self.battery_level}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment