Add entity translations to Ridwell (#98918)

This commit is contained in:
Joost Lekkerkerker 2023-08-24 10:42:05 +02:00 committed by GitHub
parent 147351be6e
commit 0a1ad8a119
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 5 deletions

View File

@ -27,7 +27,7 @@ ATTR_QUANTITY = "quantity"
SENSOR_DESCRIPTION = SensorEntityDescription( SENSOR_DESCRIPTION = SensorEntityDescription(
key=SENSOR_TYPE_NEXT_PICKUP, key=SENSOR_TYPE_NEXT_PICKUP,
name="Next Ridwell pickup", translation_key="next_pickup",
device_class=SensorDeviceClass.DATE, device_class=SensorDeviceClass.DATE,
) )

View File

@ -24,5 +24,17 @@
"already_configured": "[%key:common::config_flow::abort::already_configured_account%]", "already_configured": "[%key:common::config_flow::abort::already_configured_account%]",
"reauth_successful": "[%key:common::config_flow::abort::reauth_successful%]" "reauth_successful": "[%key:common::config_flow::abort::reauth_successful%]"
} }
},
"entity": {
"sensor": {
"next_pickup": {
"name": "Next pickup"
}
},
"switch": {
"opt_in": {
"name": "Opt-in to next pickup"
}
}
} }
} }

View File

@ -16,11 +16,9 @@ from .const import DOMAIN
from .coordinator import RidwellDataUpdateCoordinator from .coordinator import RidwellDataUpdateCoordinator
from .entity import RidwellEntity from .entity import RidwellEntity
SWITCH_TYPE_OPT_IN = "opt_in"
SWITCH_DESCRIPTION = SwitchEntityDescription( SWITCH_DESCRIPTION = SwitchEntityDescription(
key=SWITCH_TYPE_OPT_IN, key="opt_in",
name="Opt-in to next pickup", translation_key="opt_in",
icon="mdi:calendar-check", icon="mdi:calendar-check",
) )