Use new SensorStateClass enum in flunearyou (#61441)
Co-authored-by: epenet <epenet@users.noreply.github.com>pull/61450/head
parent
25838e97e0
commit
0d9d6d5727
|
@ -5,9 +5,9 @@ from collections.abc import Mapping
|
||||||
from typing import Any, Union, cast
|
from typing import Any, Union, cast
|
||||||
|
|
||||||
from homeassistant.components.sensor import (
|
from homeassistant.components.sensor import (
|
||||||
STATE_CLASS_MEASUREMENT,
|
|
||||||
SensorEntity,
|
SensorEntity,
|
||||||
SensorEntityDescription,
|
SensorEntityDescription,
|
||||||
|
SensorStateClass,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import ATTR_STATE, CONF_LATITUDE, CONF_LONGITUDE
|
from homeassistant.const import ATTR_STATE, CONF_LATITUDE, CONF_LONGITUDE
|
||||||
|
@ -58,49 +58,49 @@ USER_SENSOR_DESCRIPTIONS = (
|
||||||
name="Avian Flu Symptoms",
|
name="Avian Flu Symptoms",
|
||||||
icon="mdi:alert",
|
icon="mdi:alert",
|
||||||
native_unit_of_measurement="reports",
|
native_unit_of_measurement="reports",
|
||||||
state_class=STATE_CLASS_MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=SENSOR_TYPE_USER_DENGUE,
|
key=SENSOR_TYPE_USER_DENGUE,
|
||||||
name="Dengue Fever Symptoms",
|
name="Dengue Fever Symptoms",
|
||||||
icon="mdi:alert",
|
icon="mdi:alert",
|
||||||
native_unit_of_measurement="reports",
|
native_unit_of_measurement="reports",
|
||||||
state_class=STATE_CLASS_MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=SENSOR_TYPE_USER_FLU,
|
key=SENSOR_TYPE_USER_FLU,
|
||||||
name="Flu Symptoms",
|
name="Flu Symptoms",
|
||||||
icon="mdi:alert",
|
icon="mdi:alert",
|
||||||
native_unit_of_measurement="reports",
|
native_unit_of_measurement="reports",
|
||||||
state_class=STATE_CLASS_MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=SENSOR_TYPE_USER_LEPTO,
|
key=SENSOR_TYPE_USER_LEPTO,
|
||||||
name="Leptospirosis Symptoms",
|
name="Leptospirosis Symptoms",
|
||||||
icon="mdi:alert",
|
icon="mdi:alert",
|
||||||
native_unit_of_measurement="reports",
|
native_unit_of_measurement="reports",
|
||||||
state_class=STATE_CLASS_MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=SENSOR_TYPE_USER_NO_SYMPTOMS,
|
key=SENSOR_TYPE_USER_NO_SYMPTOMS,
|
||||||
name="No Symptoms",
|
name="No Symptoms",
|
||||||
icon="mdi:alert",
|
icon="mdi:alert",
|
||||||
native_unit_of_measurement="reports",
|
native_unit_of_measurement="reports",
|
||||||
state_class=STATE_CLASS_MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=SENSOR_TYPE_USER_SYMPTOMS,
|
key=SENSOR_TYPE_USER_SYMPTOMS,
|
||||||
name="Flu-like Symptoms",
|
name="Flu-like Symptoms",
|
||||||
icon="mdi:alert",
|
icon="mdi:alert",
|
||||||
native_unit_of_measurement="reports",
|
native_unit_of_measurement="reports",
|
||||||
state_class=STATE_CLASS_MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key=SENSOR_TYPE_USER_TOTAL,
|
key=SENSOR_TYPE_USER_TOTAL,
|
||||||
name="Total Symptoms",
|
name="Total Symptoms",
|
||||||
icon="mdi:alert",
|
icon="mdi:alert",
|
||||||
native_unit_of_measurement="reports",
|
native_unit_of_measurement="reports",
|
||||||
state_class=STATE_CLASS_MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue