Logbook: fix custom Icon (#7175)

This commit is contained in:
Zack Barett 2020-10-01 06:55:27 -05:00 committed by GitHub
parent ec920093d4
commit 2c827bab9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 2 deletions

View File

@ -18,7 +18,7 @@ export const binarySensorIcon = (state?: string, stateObj?: HassEntity) => {
case "garage_door":
return is_off ? "hass:garage" : "hass:garage-open";
case "power":
return is_off ? "hass:power-off" : "hass:power-on";
return is_off ? "hass:power-plug" : "hass:power-plug-off";
case "gas":
case "problem":
case "safety":

View File

@ -12,6 +12,7 @@ export interface LogbookEntry {
name: string;
message?: string;
entity_id?: string;
icon?: string;
domain: string;
context_user_id?: string;
context_event_type?: string;

View File

@ -134,7 +134,8 @@ class HaLogbook extends LitElement {
${!this.noIcon
? html`
<ha-icon
.icon=${domainIcon(
.icon=${item.icon ??
domainIcon(
item.entity_id
? computeDomain(item.entity_id)
: item.domain,