From 5b8cc660ebf571ef4e067f33424f58757cd161ac Mon Sep 17 00:00:00 2001 From: Vasilis Koulis Date: Fri, 5 Jan 2024 18:19:35 +0200 Subject: [PATCH] Fix for 2025.1 version of Home Assistant --- custom_components/tpms_ble/sensor.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/custom_components/tpms_ble/sensor.py b/custom_components/tpms_ble/sensor.py index 268fcdb..e9dc98f 100644 --- a/custom_components/tpms_ble/sensor.py +++ b/custom_components/tpms_ble/sensor.py @@ -20,9 +20,9 @@ ) from homeassistant.const import ( SIGNAL_STRENGTH_DECIBELS_MILLIWATT, - PRESSURE_BAR, PERCENTAGE, - TEMP_CELSIUS, + UnitOfPressure, + UnitOfTemperature, ) from homeassistant.core import HomeAssistant from homeassistant.helpers.entity import EntityCategory @@ -37,13 +37,13 @@ key=TPMSSensor.PRESSURE, device_class=SensorDeviceClass.PRESSURE, state_class=SensorStateClass.MEASUREMENT, - native_unit_of_measurement=PRESSURE_BAR, + native_unit_of_measurement=UnitOfPressure.BAR, ), TPMSSensor.TEMPERATURE: SensorEntityDescription( key=TPMSSensor.TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE, state_class=SensorStateClass.MEASUREMENT, - native_unit_of_measurement=TEMP_CELSIUS, + native_unit_of_measurement=UnitOfTemperature.CELSIUS, ), TPMSSensor.BATTERY: SensorEntityDescription( key=TPMSSensor.BATTERY,