mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 18:27:09 +00:00
Add long-term statistics for Flu Near You sensors (#55416)
This commit is contained in:
parent
441e99b439
commit
bbc75b5c00
@ -1,7 +1,11 @@
|
|||||||
"""Support for user- and CDC-based flu info sensors from Flu Near You."""
|
"""Support for user- and CDC-based flu info sensors from Flu Near You."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from homeassistant.components.sensor import SensorEntity, SensorEntityDescription
|
from homeassistant.components.sensor import (
|
||||||
|
STATE_CLASS_MEASUREMENT,
|
||||||
|
SensorEntity,
|
||||||
|
SensorEntityDescription,
|
||||||
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ATTR_ATTRIBUTION,
|
ATTR_ATTRIBUTION,
|
||||||
@ -57,42 +61,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,
|
||||||
),
|
),
|
||||||
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,
|
||||||
),
|
),
|
||||||
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,
|
||||||
),
|
),
|
||||||
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,
|
||||||
),
|
),
|
||||||
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,
|
||||||
),
|
),
|
||||||
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,
|
||||||
),
|
),
|
||||||
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,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user