Skip to content

Commit

Permalink
Replaced TEMP_CELSIUS with UnitOfTemperature.CELSIUS (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
shannonfritz authored Sep 13, 2023
1 parent 81d5d5a commit cf0e6a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/example_sensor/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
SensorEntity,
SensorStateClass,
)
from homeassistant.const import TEMP_CELSIUS
from homeassistant.const import UnitOfTemperature
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
Expand All @@ -26,7 +26,7 @@ class ExampleSensor(SensorEntity):
"""Representation of a Sensor."""

_attr_name = "Example Temperature"
_attr_native_unit_of_measurement = TEMP_CELSIUS
_attr_native_unit_of_measurement = UnitOfTemperature.CELSIUS
_attr_device_class = SensorDeviceClass.TEMPERATURE
_attr_state_class = SensorStateClass.MEASUREMENT

Expand Down

0 comments on commit cf0e6a4

Please sign in to comment.