Use UnitOfTime in integrations (h-s) (#84289)

This commit is contained in:
epenet 2022-12-20 13:21:14 +01:00 committed by GitHub
parent 6a8d9a91cb
commit 55a5e17cf2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 64 additions and 75 deletions

View file

@ -18,7 +18,7 @@ from homeassistant.components.sensor import (
SensorEntityDescription,
SensorStateClass,
)
from homeassistant.const import SIGNAL_STRENGTH_DECIBELS_MILLIWATT, TIME_SECONDS
from homeassistant.const import SIGNAL_STRENGTH_DECIBELS_MILLIWATT, UnitOfTime
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import EntityCategory
from homeassistant.helpers.entity_platform import AddEntitiesCallback
@ -32,7 +32,7 @@ SENSOR_DESCRIPTIONS: dict[str, SensorEntityDescription] = {
key=OralBSensor.TIME,
device_class=SensorDeviceClass.DURATION,
state_class=SensorStateClass.TOTAL_INCREASING,
native_unit_of_measurement=TIME_SECONDS,
native_unit_of_measurement=UnitOfTime.SECONDS,
),
OralBSensor.SECTOR: SensorEntityDescription(
key=OralBSensor.SECTOR,