jacdac.weight_scale

Submodules

Package Contents

Classes

WeightScaleClient

A weight measuring sensor.

class jacdac.weight_scale.WeightScaleClient(bus: jacdac.bus.Bus, role: str, *, missing_weight_value: float | None = None)

Bases: jacdac.bus.SensorClient

A weight measuring sensor. Implements a client for the Weight Scale service.

property weight: float | None

The reported weight., _: kg

property weight_error: float | None

(Optional) The estimate error on the reported reading., _: kg

property zero_offset: float | None

(Optional) Calibrated zero offset error on the scale, i.e. the measured weight when nothing is on the scale. You do not need to subtract that from the reading, it has already been done., _: kg

property gain: float | None

(Optional) Calibrated gain on the weight scale error.,

property max_weight: float | None

(Optional) Maximum supported weight on the scale., _: kg

property min_weight: float | None

(Optional) Minimum recommend weight on the scale., _: kg

property weight_resolution: float | None

(Optional) Smallest, yet distinguishable change in reading., _: kg

property variant: jacdac.weight_scale.constants.WeightScaleVariant | None

(Optional) The type of physical scale,

calibrate_zero_offset() None

Call this command when there is nothing on the scale. If supported, the module should save the calibration data.

calibrate_gain(weight: float) None

Call this command with the weight of the thing on the scale.