Use UnitOfTemperature in integrations (a-d) (#84304)

This commit is contained in:
epenet 2022-12-20 17:59:20 +01:00 committed by GitHub
parent 82efbee443
commit d89ba40010
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 73 additions and 63 deletions

View file

@ -9,7 +9,7 @@ from homeassistant.components.sensor import (
SensorEntityDescription,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import SIGNAL_STRENGTH_DECIBELS_MILLIWATT, TEMP_FAHRENHEIT
from homeassistant.const import SIGNAL_STRENGTH_DECIBELS_MILLIWATT, UnitOfTemperature
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import DeviceInfo, EntityCategory
from homeassistant.helpers.entity_platform import AddEntitiesCallback
@ -22,7 +22,7 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
SensorEntityDescription(
key=TYPE_TEMPERATURE,
name="Temperature",
native_unit_of_measurement=TEMP_FAHRENHEIT,
native_unit_of_measurement=UnitOfTemperature.FAHRENHEIT,
device_class=SensorDeviceClass.TEMPERATURE,
entity_category=EntityCategory.DIAGNOSTIC,
),