From e74a8580c2cef8f2be479baebdc47658ca8beaac Mon Sep 17 00:00:00 2001 From: killer0071234 Date: Tue, 21 May 2024 17:31:09 +0000 Subject: [PATCH] Use native_unit_of_measurement for custom sensor --- custom_components/hiq/const.py | 2 +- custom_components/hiq/sensor.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/hiq/const.py b/custom_components/hiq/const.py index a6156a3..7e73d55 100644 --- a/custom_components/hiq/const.py +++ b/custom_components/hiq/const.py @@ -11,7 +11,7 @@ ATTRIBUTION_PLC = "Data read from HIQ controller" DEVICE_DESCRIPTION = "HIQ controller" DEVICE_HW_VERSION = "2/3" -DEVICE_SW_VERSION = "0.3.0" +DEVICE_SW_VERSION = "0.3.3" LOGGER = logging.getLogger(__package__) SCAN_INTERVAL = timedelta(seconds=10) diff --git a/custom_components/hiq/sensor.py b/custom_components/hiq/sensor.py index da15bc7..82237dc 100644 --- a/custom_components/hiq/sensor.py +++ b/custom_components/hiq/sensor.py @@ -142,7 +142,7 @@ async def async_setup_entry( device_class=SensorDeviceClass(sensor_config[CONF_DEVICE_CLASS]) if sensor_config.get(CONF_DEVICE_CLASS) is not None else None, - unit_of_measurement=sensor_config.get(CONF_UNIT_OF_MEASUREMENT), + native_unit_of_measurement=sensor_config.get(CONF_UNIT_OF_MEASUREMENT), ), dev_info=dev_info, value_template=value_template,