From c7eae8b0bc73dc00038053e275b941a0ee32ac94 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Thu, 9 Dec 2021 08:29:01 +0100 Subject: [PATCH] Use new SensorDeviceClass enum in bme280 (#61319) Co-authored-by: epenet --- homeassistant/components/bme280/const.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/homeassistant/components/bme280/const.py b/homeassistant/components/bme280/const.py index e217c0df29e..1bb0828dd1e 100644 --- a/homeassistant/components/bme280/const.py +++ b/homeassistant/components/bme280/const.py @@ -3,14 +3,8 @@ from __future__ import annotations from datetime import timedelta -from homeassistant.components.sensor import SensorEntityDescription -from homeassistant.const import ( - DEVICE_CLASS_HUMIDITY, - DEVICE_CLASS_PRESSURE, - DEVICE_CLASS_TEMPERATURE, - PERCENTAGE, - TEMP_CELSIUS, -) +from homeassistant.components.sensor import SensorDeviceClass, SensorEntityDescription +from homeassistant.const import PERCENTAGE, TEMP_CELSIUS # Common DOMAIN = "bme280" @@ -34,19 +28,19 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = ( key=SENSOR_TEMP, name="Temperature", native_unit_of_measurement=TEMP_CELSIUS, - device_class=DEVICE_CLASS_TEMPERATURE, + device_class=SensorDeviceClass.TEMPERATURE, ), SensorEntityDescription( key=SENSOR_HUMID, name="Humidity", native_unit_of_measurement=PERCENTAGE, - device_class=DEVICE_CLASS_HUMIDITY, + device_class=SensorDeviceClass.HUMIDITY, ), SensorEntityDescription( key=SENSOR_PRESS, name="Pressure", native_unit_of_measurement="mb", - device_class=DEVICE_CLASS_PRESSURE, + device_class=SensorDeviceClass.PRESSURE, ), ) SENSOR_KEYS: list[str] = [desc.key for desc in SENSOR_TYPES]