mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 02:37:08 +00:00
Add entity translations to filesize (#95299)
This commit is contained in:
parent
7737271a30
commit
ad9bf431a8
@ -34,17 +34,17 @@ ICON = "mdi:file"
|
|||||||
SENSOR_TYPES = (
|
SENSOR_TYPES = (
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key="file",
|
key="file",
|
||||||
|
translation_key="size",
|
||||||
icon=ICON,
|
icon=ICON,
|
||||||
name="Size",
|
|
||||||
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
|
native_unit_of_measurement=UnitOfInformation.MEGABYTES,
|
||||||
device_class=SensorDeviceClass.DATA_SIZE,
|
device_class=SensorDeviceClass.DATA_SIZE,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key="bytes",
|
key="bytes",
|
||||||
|
translation_key="size_bytes",
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
icon=ICON,
|
icon=ICON,
|
||||||
name="Size bytes",
|
|
||||||
native_unit_of_measurement=UnitOfInformation.BYTES,
|
native_unit_of_measurement=UnitOfInformation.BYTES,
|
||||||
device_class=SensorDeviceClass.DATA_SIZE,
|
device_class=SensorDeviceClass.DATA_SIZE,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
@ -52,9 +52,9 @@ SENSOR_TYPES = (
|
|||||||
),
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
key="last_updated",
|
key="last_updated",
|
||||||
|
translation_key="last_updated",
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
icon=ICON,
|
icon=ICON,
|
||||||
name="Last Updated",
|
|
||||||
device_class=SensorDeviceClass.TIMESTAMP,
|
device_class=SensorDeviceClass.TIMESTAMP,
|
||||||
entity_category=EntityCategory.DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
),
|
),
|
||||||
|
@ -15,5 +15,18 @@
|
|||||||
"already_configured": "[%key:common::config_flow::abort::already_configured_service%]"
|
"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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user