ScaleBase

class ScaleBase[source]

Bases: object

Base class for Scale interface.

error

Error message.

Type:

str

__init__()

Methods

__init__()

calibrate(weight)

Calibrates the scale using a known weight.

get_weight()

Gets the current weight.

tare()

Tares the scale.

Attributes

error: str = 'Error connecting to the scale '
tare() None[source]

Tares the scale.

calibrate(weight: float) None[source]

Calibrates the scale using a known weight.

Parameters:

weight (float) – The known weight.

get_weight() float[source]

Gets the current weight.

Returns:

The weight reading (default 0.0).

Return type:

float