add fs stats in get_batt

This commit is contained in:
Florent 2025-06-27 11:02:29 +02:00
parent 5be498145a
commit 73e896737a
2 changed files with 4 additions and 1 deletions

View file

@ -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" },

View file

@ -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: