sensor_reading
frog.sensor_reading
¤
Provides a class for representing physical quantities monitored by sensors.
Classes¤
SensorReading(name, value, unit)
dataclass
¤
Class for representing physical quantities monitored by sensors.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
human-readable name of the physical quantity |
required |
value
|
Decimal | float
|
value of the physical quantity |
required |
unit
|
str
|
unit in which the value is presented |
required |
Functions¤
__str__()
¤
Print a property's name, value and unit in a readable format.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The name, value and unit of a property. |
Source code in frog/sensor_reading.py
21 22 23 24 25 26 27 |
|
val_str()
¤
Print a property's value and unit in required format.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The value and unit of a property |
Source code in frog/sensor_reading.py
29 30 31 32 33 34 35 |
|