mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Use new SensorDeviceClass enum in glances (#61613)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
704be10561
commit
c060b5926c
@ -4,14 +4,8 @@ from __future__ import annotations
|
|||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from homeassistant.components.sensor import SensorEntityDescription
|
from homeassistant.components.sensor import SensorDeviceClass, SensorEntityDescription
|
||||||
from homeassistant.const import (
|
from homeassistant.const import DATA_GIBIBYTES, DATA_MEBIBYTES, PERCENTAGE, TEMP_CELSIUS
|
||||||
DATA_GIBIBYTES,
|
|
||||||
DATA_MEBIBYTES,
|
|
||||||
DEVICE_CLASS_TEMPERATURE,
|
|
||||||
PERCENTAGE,
|
|
||||||
TEMP_CELSIUS,
|
|
||||||
)
|
|
||||||
|
|
||||||
DOMAIN = "glances"
|
DOMAIN = "glances"
|
||||||
CONF_VERSION = "version"
|
CONF_VERSION = "version"
|
||||||
@ -150,14 +144,14 @@ SENSOR_TYPES: tuple[GlancesSensorEntityDescription, ...] = (
|
|||||||
type="sensors",
|
type="sensors",
|
||||||
name_suffix="Temperature",
|
name_suffix="Temperature",
|
||||||
native_unit_of_measurement=TEMP_CELSIUS,
|
native_unit_of_measurement=TEMP_CELSIUS,
|
||||||
device_class=DEVICE_CLASS_TEMPERATURE,
|
device_class=SensorDeviceClass.TEMPERATURE,
|
||||||
),
|
),
|
||||||
GlancesSensorEntityDescription(
|
GlancesSensorEntityDescription(
|
||||||
key="temperature_hdd",
|
key="temperature_hdd",
|
||||||
type="sensors",
|
type="sensors",
|
||||||
name_suffix="Temperature",
|
name_suffix="Temperature",
|
||||||
native_unit_of_measurement=TEMP_CELSIUS,
|
native_unit_of_measurement=TEMP_CELSIUS,
|
||||||
device_class=DEVICE_CLASS_TEMPERATURE,
|
device_class=SensorDeviceClass.TEMPERATURE,
|
||||||
),
|
),
|
||||||
GlancesSensorEntityDescription(
|
GlancesSensorEntityDescription(
|
||||||
key="fan_speed",
|
key="fan_speed",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user