Expose ping drop rate Starlink sensor (#91444)
This commit is contained in:
parent
1dc0870163
commit
00191ace6c
1 changed files with 14 additions and 1 deletions
|
@ -12,7 +12,13 @@ from homeassistant.components.sensor import (
|
|||
SensorStateClass,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import DEGREE, EntityCategory, UnitOfDataRate, UnitOfTime
|
||||
from homeassistant.const import (
|
||||
DEGREE,
|
||||
PERCENTAGE,
|
||||
EntityCategory,
|
||||
UnitOfDataRate,
|
||||
UnitOfTime,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import StateType
|
||||
|
@ -119,4 +125,11 @@ SENSORS: tuple[StarlinkSensorEntityDescription, ...] = (
|
|||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
value_fn=lambda data: now() - timedelta(seconds=data.status["uptime"]),
|
||||
),
|
||||
StarlinkSensorEntityDescription(
|
||||
key="ping_drop_rate",
|
||||
name="Ping Drop Rate",
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
value_fn=lambda data: data.status["pop_ping_drop_rate"],
|
||||
),
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue