src.bluetooth_sig.gatt.characteristics.battery_health_status

Battery Health Status characteristic implementation.

Implements the Battery Health Status characteristic (0x2BEA) from the Battery Service. An 8-bit flags field controls the presence of four optional fields.

All flag bits use normal logic (1 = present, 0 = absent).

References

Bluetooth SIG Battery Service 1.1 org.bluetooth.characteristic.battery_health_status (GSS YAML)

Classes

Name

Description

BatteryHealthStatus

Parsed data from Battery Health Status characteristic.

BatteryHealthStatusCharacteristic

Battery Health Status characteristic (0x2BEA).

BatteryHealthStatusFlags

Battery Health Status flags as per Bluetooth SIG specification.

Module Contents

class src.bluetooth_sig.gatt.characteristics.battery_health_status.BatteryHealthStatus

Bases: msgspec.Struct

Parsed data from Battery Health Status characteristic.

flags

Raw 8-bit flags field.

battery_health_summary

Percentage 0-100 representing overall health. None if absent.

cycle_count

Number of charge cycles. None if absent.

current_temperature

Current temperature in degrees Celsius. 127 means “>126”, -128 means “<-127”. None if absent.

deep_discharge_count

Number of complete discharges. None if absent.

battery_health_summary: int | None = None
current_temperature: int | None = None
cycle_count: int | None = None
deep_discharge_count: int | None = None
flags: BatteryHealthStatusFlags
class src.bluetooth_sig.gatt.characteristics.battery_health_status.BatteryHealthStatusCharacteristic(info: src.bluetooth_sig.types.CharacteristicInfo | None = None, validation: src.bluetooth_sig.gatt.characteristics.characteristic_meta.ValidationConfig | None = None)

Bases: src.bluetooth_sig.gatt.characteristics.base.BaseCharacteristic[BatteryHealthStatus]

Battery Health Status characteristic (0x2BEA).

Reports battery health information including summary percentage, cycle count, temperature, and deep discharge count.

Flag-bit assignments (from GSS YAML):

Bit 0: Battery Health Summary Present Bit 1: Cycle Count Present Bit 2: Current Temperature Present Bit 3: Deep Discharge Count Present Bits 4-7: Reserved for Future Use

allow_variable_length: bool = True
expected_type
min_length: int = 1
class src.bluetooth_sig.gatt.characteristics.battery_health_status.BatteryHealthStatusFlags

Bases: enum.IntFlag

Battery Health Status flags as per Bluetooth SIG specification.

CURRENT_TEMPERATURE_PRESENT = 4
CYCLE_COUNT_PRESENT = 2
DEEP_DISCHARGE_COUNT_PRESENT = 8
HEALTH_SUMMARY_PRESENT = 1