j5.components.battery_sensor module

Classes for Battery Sensing Components.

class j5.components.battery_sensor.BatterySensor(identifier: int, backend: j5.components.battery_sensor.BatterySensorInterface)[source]

Bases: j5.components.component.Component

A sensor capable of monitoring a battery.

current

Get the current of the battery sensor.

Returns:current measured by the sensor.
identifier

An integer to identify the component on a board.

Returns:component identifier.
static interface_class() → Type[j5.components.battery_sensor.BatterySensorInterface][source]

Get the interface class that is required to use this component.

Returns:interface class.
voltage

Get the voltage reported by the battery sensor.

Returns:voltage measured by the sensor.
class j5.components.battery_sensor.BatterySensorInterface[source]

Bases: j5.components.component.Interface

An interface containing the methods required to read data from a BatterySensor.

get_battery_sensor_current(identifier: int) → float[source]

Get the current of a battery sensor.

Parameters:identifier – Identifier of battery sensor.
Returns:current measured by the sensor.
get_battery_sensor_voltage(identifier: int) → float[source]

Get the voltage of a battery sensor.

Parameters:identifier – Identifier of battery sensor.
Returns:voltage measured by the sensor.