|
| None | __init__ (self, str name, *UnitOfPrecipitationDepth accumulated_precipitation, UnitOfArea area, dict[tuple[SensorDeviceClass|str|None, str|None], str] conversions, UnitOfLength length, UnitOfMass mass, UnitOfPressure pressure, UnitOfTemperature temperature, UnitOfVolume volume, UnitOfSpeed wind_speed) |
| |
| float | accumulated_precipitation (self, float|None precip, str from_unit) |
| |
| float | area (self, float|None area, str from_unit) |
| |
| dict[str, str] | as_dict (self) |
| |
| str|None | get_converted_unit (self, SensorDeviceClass|str|None device_class, str|None original_unit) |
| |
| float | length (self, float|None length, str from_unit) |
| |
| float | pressure (self, float|None pressure, str from_unit) |
| |
| float | temperature (self, float temperature, str from_unit) |
| |
| float | volume (self, float|None volume, str from_unit) |
| |
| float | wind_speed (self, float|None wind_speed, str from_unit) |
| |
A container for units of measure.
Definition at line 85 of file unit_system.py.
◆ __init__()
| None homeassistant.util.unit_system.UnitSystem.__init__ |
( |
|
self, |
|
|
str |
name, |
|
|
*UnitOfPrecipitationDepth |
accumulated_precipitation, |
|
|
UnitOfArea |
area, |
|
|
dict[tuple[SensorDeviceClass | str | None, str | None], str] |
conversions, |
|
|
UnitOfLength |
length, |
|
|
UnitOfMass |
mass, |
|
|
UnitOfPressure |
pressure, |
|
|
UnitOfTemperature |
temperature, |
|
|
UnitOfVolume |
volume, |
|
|
UnitOfSpeed |
wind_speed |
|
) |
| |
Initialize the unit system object.
Definition at line 88 of file unit_system.py.
◆ accumulated_precipitation()
| float homeassistant.util.unit_system.UnitSystem.accumulated_precipitation |
( |
|
self, |
|
|
float | None |
precip, |
|
|
str |
from_unit |
|
) |
| |
Convert the given length to this unit system.
Definition at line 151 of file unit_system.py.
◆ area()
| float homeassistant.util.unit_system.UnitSystem.area |
( |
|
self, |
|
|
float | None |
area, |
|
|
str |
from_unit |
|
) |
| |
Convert the given area to this unit system.
Definition at line 161 of file unit_system.py.
◆ as_dict()
| dict[str, str] homeassistant.util.unit_system.UnitSystem.as_dict |
( |
|
self | ) |
|
Convert the unit system to a dictionary.
Definition at line 201 of file unit_system.py.
◆ get_converted_unit()
| str | None homeassistant.util.unit_system.UnitSystem.get_converted_unit |
( |
|
self, |
|
|
SensorDeviceClass | str | None |
device_class, |
|
|
str | None |
original_unit |
|
) |
| |
Return converted unit given a device class or an original unit.
Definition at line 214 of file unit_system.py.
◆ length()
| float homeassistant.util.unit_system.UnitSystem.length |
( |
|
self, |
|
|
float | None |
length, |
|
|
str |
from_unit |
|
) |
| |
Convert the given length to this unit system.
Definition at line 141 of file unit_system.py.
◆ pressure()
| float homeassistant.util.unit_system.UnitSystem.pressure |
( |
|
self, |
|
|
float | None |
pressure, |
|
|
str |
from_unit |
|
) |
| |
Convert the given pressure to this unit system.
Definition at line 171 of file unit_system.py.
◆ temperature()
| float homeassistant.util.unit_system.UnitSystem.temperature |
( |
|
self, |
|
|
float |
temperature, |
|
|
str |
from_unit |
|
) |
| |
Convert the given temperature to this unit system.
Definition at line 132 of file unit_system.py.
◆ volume()
| float homeassistant.util.unit_system.UnitSystem.volume |
( |
|
self, |
|
|
float | None |
volume, |
|
|
str |
from_unit |
|
) |
| |
Convert the given volume to this unit system.
Definition at line 191 of file unit_system.py.
◆ wind_speed()
| float homeassistant.util.unit_system.UnitSystem.wind_speed |
( |
|
self, |
|
|
float | None |
wind_speed, |
|
|
str |
from_unit |
|
) |
| |
Convert the given wind_speed to this unit system.
Definition at line 181 of file unit_system.py.
◆ _conversions
| homeassistant.util.unit_system.UnitSystem._conversions |
|
private |
◆ _name
| homeassistant.util.unit_system.UnitSystem._name |
|
private |
◆ accumulated_precipitation_unit
| homeassistant.util.unit_system.UnitSystem.accumulated_precipitation_unit |
◆ area_unit
| homeassistant.util.unit_system.UnitSystem.area_unit |
◆ length_unit
| homeassistant.util.unit_system.UnitSystem.length_unit |
◆ mass_unit
| homeassistant.util.unit_system.UnitSystem.mass_unit |
◆ pressure_unit
| homeassistant.util.unit_system.UnitSystem.pressure_unit |
◆ temperature_unit
| homeassistant.util.unit_system.UnitSystem.temperature_unit |
◆ volume_unit
| homeassistant.util.unit_system.UnitSystem.volume_unit |
◆ wind_speed_unit
| homeassistant.util.unit_system.UnitSystem.wind_speed_unit |
The documentation for this class was generated from the following file: