Use entity name translations in Verisure ()

This commit is contained in:
Franck Nijhof 2023-03-27 16:55:10 +02:00 committed by GitHub
parent fd3280260d
commit 89f89cab2c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 3 deletions
homeassistant/components/verisure

View file

@ -98,7 +98,7 @@ class VerisureEthernetStatus(
_attr_device_class = BinarySensorDeviceClass.CONNECTIVITY
_attr_entity_category = EntityCategory.DIAGNOSTIC
_attr_has_entity_name = True
_attr_name = "Ethernet status"
_attr_translation_key = "ethernet"
@property
def unique_id(self) -> str:

View file

@ -47,7 +47,7 @@ class VerisureThermometer(
_attr_device_class = SensorDeviceClass.TEMPERATURE
_attr_has_entity_name = True
_attr_name = "Temperature"
_attr_translation_key = "temperature"
_attr_native_unit_of_measurement = UnitOfTemperature.CELSIUS
_attr_state_class = SensorStateClass.MEASUREMENT
@ -99,7 +99,7 @@ class VerisureHygrometer(
_attr_device_class = SensorDeviceClass.HUMIDITY
_attr_has_entity_name = True
_attr_name = "Humidity"
_attr_translation_key = "humidity"
_attr_native_unit_of_measurement = PERCENTAGE
_attr_state_class = SensorStateClass.MEASUREMENT

View file

@ -56,5 +56,20 @@
"error": {
"code_format_mismatch": "The default PIN code does not match the required number of digits"
}
},
"entity": {
"binary_sensor": {
"ethernet": {
"name": "Ethernet status"
}
},
"sensor": {
"humidity": {
"name": "[%key:component::sensor::entity_component::humidity::name%]"
},
"temperature": {
"name": "[%key:component::sensor::entity_component::temperature::name%]"
}
}
}
}