diff --git a/src/main.cpp b/src/main.cpp index 9e46021c9..6e44f5bfe 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1477,6 +1477,7 @@ extern meshtastic_DeviceMetadata getDeviceMetadata() deviceMetadata.hw_model = HW_VENDOR; deviceMetadata.hasRemoteHardware = moduleConfig.remote_hardware.enabled; deviceMetadata.excluded_modules = meshtastic_ExcludedModules_EXCLUDED_NONE; + deviceMetadata.remaining_battery = powerStatus->getBatteryChargePercent(); #if MESHTASTIC_EXCLUDE_REMOTEHARDWARE deviceMetadata.excluded_modules |= meshtastic_ExcludedModules_REMOTEHARDWARE_CONFIG; #endif diff --git a/src/mesh/generated/meshtastic/mesh.pb.h b/src/mesh/generated/meshtastic/mesh.pb.h index 1d1ff47e0..249d41b97 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.h +++ b/src/mesh/generated/meshtastic/mesh.pb.h @@ -1110,6 +1110,8 @@ typedef struct _meshtastic_DeviceMetadata { bool hasRemoteHardware; /* Has PKC capabilities */ bool hasPKC; + /* How much battery the device has left */ + uint8_t remaining_battery; /* Bit field of boolean for excluded modules (bitwise OR of ExcludedModules) */ uint32_t excluded_modules;