Add entity translations to Eufylife BLE (#95296)

pull/95269/head
Joost Lekkerkerker 2023-06-26 23:32:37 +02:00 committed by GitHub
parent a568885ad2
commit 9734f45202
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 3 deletions

View File

@ -86,7 +86,7 @@ class EufyLifeSensorEntity(SensorEntity):
class EufyLifeRealTimeWeightSensorEntity(EufyLifeSensorEntity):
"""Representation of an EufyLife real-time weight sensor."""
_attr_name = "Real-time weight"
_attr_translation_key = "real_time_weight"
_attr_native_unit_of_measurement = UnitOfMass.KILOGRAMS
_attr_device_class = SensorDeviceClass.WEIGHT
@ -115,7 +115,7 @@ class EufyLifeRealTimeWeightSensorEntity(EufyLifeSensorEntity):
class EufyLifeWeightSensorEntity(RestoreEntity, EufyLifeSensorEntity):
"""Representation of an EufyLife weight sensor."""
_attr_name = "Weight"
_attr_translation_key = "weight"
_attr_native_unit_of_measurement = UnitOfMass.KILOGRAMS
_attr_device_class = SensorDeviceClass.WEIGHT
@ -176,7 +176,7 @@ class EufyLifeWeightSensorEntity(RestoreEntity, EufyLifeSensorEntity):
class EufyLifeHeartRateSensorEntity(RestoreEntity, EufyLifeSensorEntity):
"""Representation of an EufyLife heart rate sensor."""
_attr_name = "Heart rate"
_attr_translation_key = "heart_rate"
_attr_icon = "mdi:heart-pulse"
_attr_native_unit_of_measurement = "bpm"

View File

@ -18,5 +18,18 @@
"already_in_progress": "[%key:common::config_flow::abort::already_in_progress%]",
"already_configured": "[%key:common::config_flow::abort::already_configured_device%]"
}
},
"entity": {
"sensor": {
"real_time_weight": {
"name": "Real-time weight"
},
"weight": {
"name": "Weight"
},
"heart_rate": {
"name": "Heart rate"
}
}
}
}