mirror of
https://github.com/meshcore-dev/meshcore_py.git
synced 2026-06-11 11:56:18 +00:00
add fs stats in get_batt
This commit is contained in:
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "meshcore"
|
name = "meshcore"
|
||||||
version = "1.9.11"
|
version = "1.9.12"
|
||||||
authors = [
|
authors = [
|
||||||
{ name="Florent de Lamotte", email="florent@frizoncorrea.fr" },
|
{ name="Florent de Lamotte", email="florent@frizoncorrea.fr" },
|
||||||
{ name="Alex Wolden", email="awolden@gmail.com" },
|
{ name="Alex Wolden", email="awolden@gmail.com" },
|
||||||
|
|||||||
@@ -189,6 +189,9 @@ class MessageReader:
|
|||||||
elif packet_type_value == PacketType.BATTERY.value:
|
elif packet_type_value == PacketType.BATTERY.value:
|
||||||
battery_level = int.from_bytes(data[1:3], byteorder='little')
|
battery_level = int.from_bytes(data[1:3], byteorder='little')
|
||||||
result = {"level": battery_level}
|
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))
|
await self.dispatcher.dispatch(Event(EventType.BATTERY, result))
|
||||||
|
|
||||||
elif packet_type_value == PacketType.DEVICE_INFO.value:
|
elif packet_type_value == PacketType.DEVICE_INFO.value:
|
||||||
|
|||||||
Reference in New Issue
Block a user