Add icon translations to Starlink (#112244)

This commit is contained in:
Joost Lekkerkerker 2024-03-04 20:05:15 +01:00 committed by GitHub
parent 55d4299269
commit c5e11a00ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 24 additions and 6 deletions

View file

@ -0,0 +1,24 @@
{
"entity": {
"sensor": {
"ping": {
"default": "mdi:speedometer"
},
"azimuth": {
"default": "mdi:compass"
},
"elevation": {
"default": "mdi:compass"
},
"uplink_throughput": {
"default": "mdi:upload"
},
"downlink_throughput": {
"default": "mdi:download"
},
"last_boot_time": {
"default": "mdi:clock"
}
}
}
}

View file

@ -69,7 +69,6 @@ SENSORS: tuple[StarlinkSensorEntityDescription, ...] = (
StarlinkSensorEntityDescription(
key="ping",
translation_key="ping",
icon="mdi:speedometer",
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfTime.MILLISECONDS,
suggested_display_precision=0,
@ -78,7 +77,6 @@ SENSORS: tuple[StarlinkSensorEntityDescription, ...] = (
StarlinkSensorEntityDescription(
key="azimuth",
translation_key="azimuth",
icon="mdi:compass",
state_class=SensorStateClass.MEASUREMENT,
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=DEGREE,
@ -89,7 +87,6 @@ SENSORS: tuple[StarlinkSensorEntityDescription, ...] = (
StarlinkSensorEntityDescription(
key="elevation",
translation_key="elevation",
icon="mdi:compass",
state_class=SensorStateClass.MEASUREMENT,
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=DEGREE,
@ -100,7 +97,6 @@ SENSORS: tuple[StarlinkSensorEntityDescription, ...] = (
StarlinkSensorEntityDescription(
key="uplink_throughput",
translation_key="uplink_throughput",
icon="mdi:upload",
state_class=SensorStateClass.MEASUREMENT,
device_class=SensorDeviceClass.DATA_RATE,
native_unit_of_measurement=UnitOfDataRate.BITS_PER_SECOND,
@ -110,7 +106,6 @@ SENSORS: tuple[StarlinkSensorEntityDescription, ...] = (
StarlinkSensorEntityDescription(
key="downlink_throughput",
translation_key="downlink_throughput",
icon="mdi:download",
state_class=SensorStateClass.MEASUREMENT,
device_class=SensorDeviceClass.DATA_RATE,
native_unit_of_measurement=UnitOfDataRate.BITS_PER_SECOND,
@ -120,7 +115,6 @@ SENSORS: tuple[StarlinkSensorEntityDescription, ...] = (
StarlinkSensorEntityDescription(
key="last_boot_time",
translation_key="last_boot_time",
icon="mdi:clock",
device_class=SensorDeviceClass.TIMESTAMP,
entity_category=EntityCategory.DIAGNOSTIC,
value_fn=lambda data: now() - timedelta(seconds=data.status["uptime"]),