Public Member Functions | |
| 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) |
Public Member Functions inherited from homeassistant.util.unit_conversion.BaseUnitConverter | |
| float | convert (cls, float value, str|None from_unit, str|None to_unit) |
| float | get_unit_ratio (cls, str|None from_unit, str|None to_unit) |
Static Public Attributes | |
| string | UNIT_CLASS = "speed" |
| dictionary | VALID_UNITS |
Private Member Functions | |
| float | _beaufort_to_ms (cls, float beaufort) |
| Callable[[float], float] | _converter_factory (cls, str|None from_unit, str|None to_unit) |
| float | _ms_to_beaufort (cls, float ms) |
Utility to convert speed values.
Definition at line 387 of file unit_conversion.py.
|
private |
Convert a speed in Beaufort to m/s.
Definition at line 480 of file unit_conversion.py.
|
private |
Convert a speed from one unit to another, eg. 14m/s will return 7Bft.
Definition at line 450 of file unit_conversion.py.
|
private |
Convert a speed in m/s to Beaufort.
Definition at line 475 of file unit_conversion.py.
| Callable[[float], float] homeassistant.util.unit_conversion.SpeedConverter.converter_factory | ( | cls, | |
| str | None | from_unit, | ||
| str | None | to_unit | ||
| ) |
Return a function to convert a speed from one unit to another.
Reimplemented from homeassistant.util.unit_conversion.BaseUnitConverter.
Definition at line 422 of file unit_conversion.py.
| Callable[[float | None], float | None] homeassistant.util.unit_conversion.SpeedConverter.converter_factory_allow_none | ( | cls, | |
| str | None | from_unit, | ||
| str | None | to_unit | ||
| ) |
Return a function to convert a speed from one unit to another which allows None.
Reimplemented from homeassistant.util.unit_conversion.BaseUnitConverter.
Definition at line 436 of file unit_conversion.py.
|
static |
Definition at line 390 of file unit_conversion.py.
|
static |
Definition at line 405 of file unit_conversion.py.