From e4c25006452c39af11572c76966fdf039c7c67dd Mon Sep 17 00:00:00 2001 From: Andrey Khrolenok Date: Tue, 27 Feb 2024 10:13:09 +0300 Subject: [PATCH] Remove deprecated constant --- custom_components/iaquk/const.py | 2 +- custom_components/iaquk/manifest.json | 2 +- custom_components/iaquk/sensor.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/custom_components/iaquk/const.py b/custom_components/iaquk/const.py index a245cfd..993e6bd 100644 --- a/custom_components/iaquk/const.py +++ b/custom_components/iaquk/const.py @@ -6,7 +6,7 @@ # Base component constants NAME: Final = "Indoor Air Quality UK Index" DOMAIN: Final = "iaquk" -VERSION: Final = "1.6.6" +VERSION: Final = "1.6.7-alpha" ISSUE_URL: Final = "https://github.com/Limych/ha-iaquk/issues" STARTUP_MESSAGE: Final = f""" diff --git a/custom_components/iaquk/manifest.json b/custom_components/iaquk/manifest.json index 775a733..e9e6819 100644 --- a/custom_components/iaquk/manifest.json +++ b/custom_components/iaquk/manifest.json @@ -10,5 +10,5 @@ "iot_class": "calculated", "issue_tracker": "https://github.com/Limych/ha-iaquk/issues", "requirements": [], - "version": "1.6.6" + "version": "1.6.7-alpha" } \ No newline at end of file diff --git a/custom_components/iaquk/sensor.py b/custom_components/iaquk/sensor.py index ef4376a..7e67644 100644 --- a/custom_components/iaquk/sensor.py +++ b/custom_components/iaquk/sensor.py @@ -6,8 +6,8 @@ from homeassistant.components.sensor import ( ENTITY_ID_FORMAT, - STATE_CLASS_MEASUREMENT, SensorEntity, + SensorStateClass, ) from homeassistant.const import CONF_NAME, CONF_SENSORS from homeassistant.core import HomeAssistant @@ -73,7 +73,7 @@ def __init__(self, controller, sensor_type: str): self._attr_unique_id = f"{controller.unique_id}_{sensor_type}" self._attr_name = f"{controller.name} {SENSORS[sensor_type]}" self._attr_state_class = ( - STATE_CLASS_MEASUREMENT if sensor_type == SENSOR_INDEX else None + SensorStateClass.MEASUREMENT if sensor_type == SENSOR_INDEX else None ) self._attr_device_class = ( f"{DOMAIN}__level" if sensor_type == SENSOR_LEVEL else None