Skip to content

Commit

Permalink
Merge pull request #154 from cpether/patch-2
Browse files Browse the repository at this point in the history
Update depricated units
  • Loading branch information
KJonline authored Feb 12, 2024
2 parents 486336c + 902b027 commit e80f29d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions custom_components/hive/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
SensorStateClass,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import PERCENTAGE, POWER_WATT, TEMP_CELSIUS
from homeassistant.const import PERCENTAGE, UnitOfPower, UnitOfTemperature
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import EntityCategory
from homeassistant.helpers.entity_platform import AddEntitiesCallback
Expand All @@ -28,7 +28,7 @@
),
SensorEntityDescription(
key="Power",
native_unit_of_measurement=POWER_WATT,
native_unit_of_measurement=UnitOfPower.WATT,
state_class=SensorStateClass.MEASUREMENT,
device_class=SensorDeviceClass.POWER,
entity_category=EntityCategory.DIAGNOSTIC,
Expand All @@ -37,14 +37,14 @@
key="Heating_Current_Temperature",
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=TEMP_CELSIUS,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
icon="mdi:thermometer",
),
SensorEntityDescription(
key="Heating_Target_Temperature",
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=TEMP_CELSIUS,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
icon="mdi:thermometer",
),
SensorEntityDescription(
Expand Down

0 comments on commit e80f29d

Please sign in to comment.