Import full set of entity icons.

This commit is contained in:
Dermot Duffy
2022-05-02 20:28:14 -07:00
parent 69a49f57c2
commit 9248075d19
10 changed files with 752 additions and 3 deletions
+3 -3
View File
@@ -4,7 +4,6 @@ import {
computeStateDomain,
handleActionConfig,
hasAction,
stateIcon,
ActionConfig,
} from 'custom-card-helpers';
import { StyleInfo } from 'lit/directives/style-map.js';
@@ -34,6 +33,7 @@ import {
signedPathSchema,
StateParameters,
} from './types.js';
import { stateIcon } from './icons/state-icon.js'
const MEDIA_INFO_HEIGHT_CUTOFF = 50;
const MEDIA_INFO_WIDTH_CUTOFF = MEDIA_INFO_HEIGHT_CUTOFF;
@@ -476,8 +476,8 @@ export function getEntityTitle(
export function getEntityIcon(
hass?: HomeAssistant,
entity?: string,
): string | undefined {
return hass && entity ? stateIcon(hass.states[entity]) : undefined;
): string {
return stateIcon(entity ? hass?.states[entity] : null);
}
/**