Use new unit enums in helpers (#83387)

This commit is contained in:
epenet 2022-12-06 22:20:17 +01:00 committed by GitHub
parent 511fd293b6
commit 9f7fd8956f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 7 deletions

View file

@ -38,8 +38,8 @@ from homeassistant.const import (
ATTR_LONGITUDE,
ATTR_PERSONS,
ATTR_UNIT_OF_MEASUREMENT,
LENGTH_METERS,
STATE_UNKNOWN,
UnitOfLength,
)
from homeassistant.core import (
Context,
@ -1364,7 +1364,7 @@ def distance(hass, *args):
return hass.config.distance(*locations[0])
return hass.config.units.length(
loc_util.distance(*locations[0] + locations[1]), LENGTH_METERS
loc_util.distance(*locations[0] + locations[1]), UnitOfLength.METERS
)