Add entity translations to Geocaching (#95396)

This commit is contained in:
Joost Lekkerkerker 2023-06-27 19:42:55 +02:00 committed by GitHub
parent 243abf32c0
commit e8cb9fba7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 5 deletions

View File

@ -36,14 +36,14 @@ class GeocachingSensorEntityDescription(
SENSORS: tuple[GeocachingSensorEntityDescription, ...] = (
GeocachingSensorEntityDescription(
key="find_count",
name="Total finds",
translation_key="find_count",
icon="mdi:notebook-edit-outline",
native_unit_of_measurement="caches",
value_fn=lambda status: status.user.find_count,
),
GeocachingSensorEntityDescription(
key="hide_count",
name="Total hides",
translation_key="hide_count",
icon="mdi:eye-off-outline",
native_unit_of_measurement="caches",
entity_registry_visible_default=False,
@ -51,7 +51,7 @@ SENSORS: tuple[GeocachingSensorEntityDescription, ...] = (
),
GeocachingSensorEntityDescription(
key="favorite_points",
name="Favorite points",
translation_key="favorite_points",
icon="mdi:heart-outline",
native_unit_of_measurement="points",
entity_registry_visible_default=False,
@ -59,14 +59,14 @@ SENSORS: tuple[GeocachingSensorEntityDescription, ...] = (
),
GeocachingSensorEntityDescription(
key="souvenir_count",
name="Total souvenirs",
translation_key="souvenir_count",
icon="mdi:license",
native_unit_of_measurement="souvenirs",
value_fn=lambda status: status.user.souvenir_count,
),
GeocachingSensorEntityDescription(
key="awarded_favorite_points",
name="Awarded favorite points",
translation_key="awarded_favorite_points",
icon="mdi:heart",
native_unit_of_measurement="points",
entity_registry_visible_default=False,

View File

@ -21,5 +21,24 @@
"create_entry": {
"default": "[%key:common::config_flow::create_entry::authenticated%]"
}
},
"entity": {
"sensor": {
"find_count": {
"name": "Total finds"
},
"hide_count": {
"name": "Total hides"
},
"favorite_points": {
"name": "Favorite points"
},
"souvenir_count": {
"name": "Total souvenirs"
},
"awarded_favorite_points": {
"name": "Awarded favorite points"
}
}
}
}