Use UnitOfTemperature in integrations (n-o) (#84306)

This commit is contained in:
epenet 2022-12-20 18:39:09 +01:00 committed by GitHub
parent a6ddac9004
commit d60fe7e7cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 72 additions and 80 deletions

View file

@ -13,7 +13,7 @@ from homeassistant.components.sensor import (
SensorStateClass,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import PERCENTAGE, TEMP_CELSIUS
from homeassistant.const import PERCENTAGE, UnitOfTemperature
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
@ -78,7 +78,7 @@ class TemperatureSensor(SensorBase):
"""Representation of a Temperature Sensor."""
_attr_device_class = SensorDeviceClass.TEMPERATURE
_attr_native_unit_of_measurement = TEMP_CELSIUS
_attr_native_unit_of_measurement = UnitOfTemperature.CELSIUS
_attr_name = "Temperature"
@property