Fix call to localize in mixin

This commit is contained in:
Paulus Schoutsen 2019-01-28 09:29:45 -08:00
parent d71d5aa855
commit fa3889b549

View File

@ -78,19 +78,19 @@ export default (superClass) =>
); );
} }
if (service === "turn_on" && serviceData.entity_id) { if (service === "turn_on" && serviceData.entity_id) {
message = this.localize( message = this.hass.localize(
"ui.notification_toast.entity_turned_on", "ui.notification_toast.entity_turned_on",
"entity", "entity",
name || serviceData.entity_id name || serviceData.entity_id
); );
} else if (service === "turn_off" && serviceData.entity_id) { } else if (service === "turn_off" && serviceData.entity_id) {
message = this.localize( message = this.hass.localize(
"ui.notification_toast.entity_turned_off", "ui.notification_toast.entity_turned_off",
"entity", "entity",
name || serviceData.entity_id name || serviceData.entity_id
); );
} else { } else {
message = this.localize( message = this.hass.localize(
"ui.notification_toast.service_called", "ui.notification_toast.service_called",
"service", "service",
`${domain}/${service}` `${domain}/${service}`
@ -107,7 +107,7 @@ export default (superClass) =>
serviceData serviceData
); );
} }
const message = this.localize( const message = this.hass.localize(
"ui.notification_toast.service_call_failed", "ui.notification_toast.service_call_failed",
"service", "service",
`${domain}/${service}` `${domain}/${service}`