|
| float | convert (cls, float value, str|None from_unit, str|None to_unit) |
| |
| Callable[[float], float] | converter_factory (cls, str|None from_unit, str|None to_unit) |
| |
| Callable[[float|None], float|None] | converter_factory_allow_none (cls, str|None from_unit, str|None to_unit) |
| |
| float | get_unit_ratio (cls, str|None from_unit, str|None to_unit) |
| |
Utility to convert mass values.
Definition at line 313 of file unit_conversion.py.
◆ UNIT_CLASS
| string homeassistant.util.unit_conversion.MassConverter.UNIT_CLASS = "mass" |
|
static |
◆ VALID_UNITS
| dictionary homeassistant.util.unit_conversion.MassConverter.VALID_UNITS |
|
static |
Initial value:= {
UnitOfMass.GRAMS,
UnitOfMass.KILOGRAMS,
UnitOfMass.MILLIGRAMS,
UnitOfMass.MICROGRAMS,
UnitOfMass.OUNCES,
UnitOfMass.POUNDS,
UnitOfMass.STONES,
}
Definition at line 326 of file unit_conversion.py.
The documentation for this class was generated from the following file: