Skip to content

Commit

Permalink
Add entity translations to filesize (#95299)
Browse files Browse the repository at this point in the history
  • Loading branch information
joostlek authored Jun 26, 2023
1 parent 7737271 commit ad9bf43
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
6 changes: 3 additions & 3 deletions homeassistant/components/filesize/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,27 @@
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,
entity_category=EntityCategory.DIAGNOSTIC,
),
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,
),
Expand Down
15 changes: 14 additions & 1 deletion homeassistant/components/filesize/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
}

0 comments on commit ad9bf43

Please sign in to comment.