Use UnitOfTemperature in integrations (t-z) (#84309)

This commit is contained in:
epenet 2022-12-20 18:50:39 +01:00 committed by GitHub
parent ba043c9ebb
commit 79d3d4ceae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 59 additions and 64 deletions

View file

@ -15,7 +15,7 @@ from homeassistant.const import (
CONF_NAME,
CONF_OFFSET,
DEVICE_DEFAULT_NAME,
TEMP_CELSIUS,
UnitOfTemperature,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
@ -74,7 +74,7 @@ class TemperSensor(SensorEntity):
"""Representation of a Temper temperature sensor."""
_attr_device_class = SensorDeviceClass.TEMPERATURE
_attr_native_unit_of_measurement = TEMP_CELSIUS
_attr_native_unit_of_measurement = UnitOfTemperature.CELSIUS
def __init__(self, temper_device, name, scaling):
"""Initialize the sensor."""