mirror of
https://github.com/meshcore-dev/meshcore_py.git
synced 2026-04-20 22:13:49 +00:00
add fs stats in get_batt
This commit is contained in:
parent
5be498145a
commit
73e896737a
2 changed files with 4 additions and 1 deletions
|
|
@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|||
|
||||
[project]
|
||||
name = "meshcore"
|
||||
version = "1.9.11"
|
||||
version = "1.9.12"
|
||||
authors = [
|
||||
{ name="Florent de Lamotte", email="florent@frizoncorrea.fr" },
|
||||
{ name="Alex Wolden", email="awolden@gmail.com" },
|
||||
|
|
|
|||
|
|
@ -189,6 +189,9 @@ class MessageReader:
|
|||
elif packet_type_value == PacketType.BATTERY.value:
|
||||
battery_level = int.from_bytes(data[1:3], byteorder='little')
|
||||
result = {"level": battery_level}
|
||||
if len(data) > 3 : # has storage info as well
|
||||
result["used_kb"] = int.from_bytes(data[3:7], byteorder='little')
|
||||
result["total_kb"] = int.from_bytes(data[7:11], byteorder='little')
|
||||
await self.dispatcher.dispatch(Event(EventType.BATTERY, result))
|
||||
|
||||
elif packet_type_value == PacketType.DEVICE_INFO.value:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue