Fix logbook for binary sensor (missing device class) (#17034)

This commit is contained in:
Philip Allgaier 2023-06-26 12:50:51 +02:00 committed by GitHub
parent 3803bdc8da
commit 68fb98454f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -360,14 +360,14 @@ export const localizeStateMessage = (
if (isOn) {
return localize(`${LOGBOOK_LOCALIZE_PATH}.detected_device_class`, {
device_class: localize(
`component.binary_sensor.device_class.${device_class}`
`component.binary_sensor.entity_component.${device_class}.name`
),
});
}
if (isOff) {
return localize(`${LOGBOOK_LOCALIZE_PATH}.cleared_device_class`, {
device_class: localize(
`component.binary_sensor.device_class.${device_class}`
`component.binary_sensor.entity_component.${device_class}.name`
),
});
}