mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 04:37:06 +00:00
Add state_class to Waze travel time for statistics support (#77386)
This commit is contained in:
parent
3655958d26
commit
3c6c673a20
@ -6,7 +6,11 @@ import logging
|
||||
|
||||
from WazeRouteCalculator import WazeRouteCalculator, WRCError
|
||||
|
||||
from homeassistant.components.sensor import SensorEntity
|
||||
from homeassistant.components.sensor import (
|
||||
SensorDeviceClass,
|
||||
SensorEntity,
|
||||
SensorStateClass,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import (
|
||||
ATTR_ATTRIBUTION,
|
||||
@ -107,6 +111,8 @@ class WazeTravelTime(SensorEntity):
|
||||
"""Representation of a Waze travel time sensor."""
|
||||
|
||||
_attr_native_unit_of_measurement = TIME_MINUTES
|
||||
_attr_device_class = SensorDeviceClass.DURATION
|
||||
_attr_state_class = SensorStateClass.MEASUREMENT
|
||||
_attr_device_info = DeviceInfo(
|
||||
entry_type=DeviceEntryType.SERVICE,
|
||||
name="Waze",
|
||||
|
Loading…
x
Reference in New Issue
Block a user