Enable long-term statistics for Fast.com sensor (#97139)

This commit is contained in:
Nerdix 2023-07-24 16:59:39 +02:00 committed by GitHub
parent 57c640c83c
commit 2220396c41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,7 +3,11 @@ from __future__ import annotations
from typing import Any
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity
from homeassistant.components.sensor import (
SensorDeviceClass,
SensorEntity,
SensorStateClass,
)
from homeassistant.const import UnitOfDataRate
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
@ -31,6 +35,7 @@ class SpeedtestSensor(RestoreEntity, SensorEntity):
_attr_name = "Fast.com Download"
_attr_device_class = SensorDeviceClass.DATA_RATE
_attr_native_unit_of_measurement = UnitOfDataRate.MEGABITS_PER_SECOND
_attr_state_class = SensorStateClass.MEASUREMENT
_attr_icon = "mdi:speedometer"
_attr_should_poll = False