Skip to content

Commit

Permalink
Add UnitOfLength support for ZHA entities (#307)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeverley authored Nov 25, 2024
1 parent 9a376e7 commit 9e9a753
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions zha/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,19 @@ class UnitOfTime(StrEnum):
YEARS = "y"


class UnitOfLength(StrEnum):
"""Length units."""

MILLIMETERS = "mm"
CENTIMETERS = "cm"
METERS = "m"
KILOMETERS = "km"
INCHES = "in"
FEET = "ft"
YARDS = "yd"
MILES = "mi"


class UnitOfEnergy(StrEnum):
"""Energy units."""

Expand Down Expand Up @@ -158,6 +171,7 @@ class UnitOfEnergy(StrEnum):
UnitOfPressure.__name__: UnitOfPressure,
UnitOfVolume.__name__: UnitOfVolume,
UnitOfVolumeFlowRate.__name__: UnitOfVolumeFlowRate,
UnitOfLength.__name__: UnitOfLength,
UnitOfMass.__name__: UnitOfMass,
}

Expand Down

0 comments on commit 9e9a753

Please sign in to comment.