Use new SensorDeviceClass enum in glances (#61613)

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet 2021-12-13 05:23:34 +01:00 committed by GitHub
parent 704be10561
commit c060b5926c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,14 +4,8 @@ from __future__ import annotations
from dataclasses import dataclass
import sys
from homeassistant.components.sensor import SensorEntityDescription
from homeassistant.const import (
DATA_GIBIBYTES,
DATA_MEBIBYTES,
DEVICE_CLASS_TEMPERATURE,
PERCENTAGE,
TEMP_CELSIUS,
)
from homeassistant.components.sensor import SensorDeviceClass, SensorEntityDescription
from homeassistant.const import DATA_GIBIBYTES, DATA_MEBIBYTES, PERCENTAGE, TEMP_CELSIUS
DOMAIN = "glances"
CONF_VERSION = "version"
@ -150,14 +144,14 @@ SENSOR_TYPES: tuple[GlancesSensorEntityDescription, ...] = (
type="sensors",
name_suffix="Temperature",
native_unit_of_measurement=TEMP_CELSIUS,
device_class=DEVICE_CLASS_TEMPERATURE,
device_class=SensorDeviceClass.TEMPERATURE,
),
GlancesSensorEntityDescription(
key="temperature_hdd",
type="sensors",
name_suffix="Temperature",
native_unit_of_measurement=TEMP_CELSIUS,
device_class=DEVICE_CLASS_TEMPERATURE,
device_class=SensorDeviceClass.TEMPERATURE,
),
GlancesSensorEntityDescription(
key="fan_speed",