Use enums in qnap (#62055)

This commit is contained in:
Robert Hillis 2021-12-16 09:01:45 -05:00 committed by GitHub
parent 395fa6d15f
commit 3b9547addc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,6 +9,7 @@ import voluptuous as vol
from homeassistant.components.sensor import ( from homeassistant.components.sensor import (
PLATFORM_SCHEMA, PLATFORM_SCHEMA,
SensorDeviceClass,
SensorEntity, SensorEntity,
SensorEntityDescription, SensorEntityDescription,
) )
@ -24,7 +25,6 @@ from homeassistant.const import (
CONF_VERIFY_SSL, CONF_VERIFY_SSL,
DATA_GIBIBYTES, DATA_GIBIBYTES,
DATA_RATE_MEBIBYTES_PER_SECOND, DATA_RATE_MEBIBYTES_PER_SECOND,
DEVICE_CLASS_TEMPERATURE,
PERCENTAGE, PERCENTAGE,
TEMP_CELSIUS, TEMP_CELSIUS,
) )
@ -72,7 +72,7 @@ _SYSTEM_MON_COND: tuple[SensorEntityDescription, ...] = (
key="system_temp", key="system_temp",
name="System Temperature", name="System Temperature",
native_unit_of_measurement=TEMP_CELSIUS, native_unit_of_measurement=TEMP_CELSIUS,
device_class=DEVICE_CLASS_TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
), ),
) )
_CPU_MON_COND: tuple[SensorEntityDescription, ...] = ( _CPU_MON_COND: tuple[SensorEntityDescription, ...] = (
@ -80,7 +80,7 @@ _CPU_MON_COND: tuple[SensorEntityDescription, ...] = (
key="cpu_temp", key="cpu_temp",
name="CPU Temperature", name="CPU Temperature",
native_unit_of_measurement=TEMP_CELSIUS, native_unit_of_measurement=TEMP_CELSIUS,
device_class=DEVICE_CLASS_TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
), ),
SensorEntityDescription( SensorEntityDescription(
key="cpu_usage", key="cpu_usage",
@ -138,7 +138,7 @@ _DRIVE_MON_COND: tuple[SensorEntityDescription, ...] = (
key="drive_temp", key="drive_temp",
name="Temperature", name="Temperature",
native_unit_of_measurement=TEMP_CELSIUS, native_unit_of_measurement=TEMP_CELSIUS,
device_class=DEVICE_CLASS_TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
), ),
) )
_VOLUME_MON_COND: tuple[SensorEntityDescription, ...] = ( _VOLUME_MON_COND: tuple[SensorEntityDescription, ...] = (