Add entity translations to filesize (#95299)

This commit is contained in:
Joost Lekkerkerker 2023-06-26 23:06:27 +02:00 committed by GitHub
parent 7737271a30
commit ad9bf431a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 4 deletions

View File

@ -34,17 +34,17 @@ ICON = "mdi:file"
SENSOR_TYPES = (
SensorEntityDescription(
key="file",
translation_key="size",
icon=ICON,
name="Size",
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
device_class=SensorDeviceClass.DATA_SIZE,
state_class=SensorStateClass.MEASUREMENT,
),
SensorEntityDescription(
key="bytes",
translation_key="size_bytes",
entity_registry_enabled_default=False,
icon=ICON,
name="Size bytes",
native_unit_of_measurement=UnitOfInformation.BYTES,
device_class=SensorDeviceClass.DATA_SIZE,
state_class=SensorStateClass.MEASUREMENT,
@ -52,9 +52,9 @@ SENSOR_TYPES = (
),
SensorEntityDescription(
key="last_updated",
translation_key="last_updated",
entity_registry_enabled_default=False,
icon=ICON,
name="Last Updated",
device_class=SensorDeviceClass.TIMESTAMP,
entity_category=EntityCategory.DIAGNOSTIC,
),

View File

@ -15,5 +15,18 @@
"already_configured": "[%key:common::config_flow::abort::already_configured_service%]"
}
},
"title": "Filesize"
"title": "Filesize",
"entity": {
"sensor": {
"size": {
"name": "Size"
},
"size_bytes": {
"name": "Size in bytes"
},
"last_updated": {
"name": "Last updated"
}
}
}
}