parent
df2d0cd3e3
commit
005bc8994d
4 changed files with 46 additions and 3 deletions
|
@ -4,6 +4,7 @@ from __future__ import annotations
|
|||
from homeassistant.const import (
|
||||
UNIT_NOT_RECOGNIZED_TEMPLATE,
|
||||
UnitOfDataRate,
|
||||
UnitOfElectricCurrent,
|
||||
UnitOfElectricPotential,
|
||||
UnitOfEnergy,
|
||||
UnitOfInformation,
|
||||
|
@ -138,6 +139,18 @@ class DistanceConverter(BaseUnitConverter):
|
|||
}
|
||||
|
||||
|
||||
class ElectricCurrentConverter(BaseUnitConverter):
|
||||
"""Utility to convert electric current values."""
|
||||
|
||||
UNIT_CLASS = "electric_current"
|
||||
NORMALIZED_UNIT = UnitOfElectricCurrent.AMPERE
|
||||
_UNIT_CONVERSION: dict[str, float] = {
|
||||
UnitOfElectricCurrent.AMPERE: 1,
|
||||
UnitOfElectricCurrent.MILLIAMPERE: 1e3,
|
||||
}
|
||||
VALID_UNITS = set(UnitOfElectricCurrent)
|
||||
|
||||
|
||||
class ElectricPotentialConverter(BaseUnitConverter):
|
||||
"""Utility to convert electric potential values."""
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue