Use new enums in speedtestdotnet (#62405)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
8bd03d520b
commit
5251c1b934
1 changed files with 4 additions and 7 deletions
|
@ -5,10 +5,7 @@ from collections.abc import Callable
|
|||
from dataclasses import dataclass
|
||||
from typing import Final
|
||||
|
||||
from homeassistant.components.sensor import (
|
||||
STATE_CLASS_MEASUREMENT,
|
||||
SensorEntityDescription,
|
||||
)
|
||||
from homeassistant.components.sensor import SensorEntityDescription, SensorStateClass
|
||||
from homeassistant.const import (
|
||||
DATA_RATE_MEGABITS_PER_SECOND,
|
||||
TIME_MILLISECONDS,
|
||||
|
@ -32,20 +29,20 @@ SENSOR_TYPES: Final[tuple[SpeedtestSensorEntityDescription, ...]] = (
|
|||
key="ping",
|
||||
name="Ping",
|
||||
native_unit_of_measurement=TIME_MILLISECONDS,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
SpeedtestSensorEntityDescription(
|
||||
key="download",
|
||||
name="Download",
|
||||
native_unit_of_measurement=DATA_RATE_MEGABITS_PER_SECOND,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
value=lambda value: round(value / 10 ** 6, 2),
|
||||
),
|
||||
SpeedtestSensorEntityDescription(
|
||||
key="upload",
|
||||
name="Upload",
|
||||
native_unit_of_measurement=DATA_RATE_MEGABITS_PER_SECOND,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
value=lambda value: round(value / 10 ** 6, 2),
|
||||
),
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue