Add entity translations to Speedtest.net (#96168)
* Add entity translations to Speedtest.net * Fix tests
This commit is contained in:
parent
0735b39fbb
commit
8bbb395bec
3 changed files with 38 additions and 13 deletions
|
@ -44,20 +44,20 @@ class SpeedtestSensorEntityDescription(SensorEntityDescription):
|
|||
SENSOR_TYPES: tuple[SpeedtestSensorEntityDescription, ...] = (
|
||||
SpeedtestSensorEntityDescription(
|
||||
key="ping",
|
||||
name="Ping",
|
||||
translation_key="ping",
|
||||
native_unit_of_measurement=UnitOfTime.MILLISECONDS,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
SpeedtestSensorEntityDescription(
|
||||
key="download",
|
||||
name="Download",
|
||||
translation_key="download",
|
||||
native_unit_of_measurement=UnitOfDataRate.MEGABITS_PER_SECOND,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
value=lambda value: round(value / 10**6, 2),
|
||||
),
|
||||
SpeedtestSensorEntityDescription(
|
||||
key="upload",
|
||||
name="Upload",
|
||||
translation_key="upload",
|
||||
native_unit_of_measurement=UnitOfDataRate.MEGABITS_PER_SECOND,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
value=lambda value: round(value / 10**6, 2),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue