Format file
This commit is contained in:
@@ -101,42 +101,42 @@ export function domainIcon(domain: string, entity?: HassEntity, state?: string):
|
|||||||
return 'mdi:lock';
|
return 'mdi:lock';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Taken from https://github.com/home-assistant/frontend/blob/45646eaf0bfc86aa0d0d6b73809ef0b32abb5729/src/common/entity/domain_icon.ts#L138-L172
|
// Taken from https://github.com/home-assistant/frontend/blob/45646eaf0bfc86aa0d0d6b73809ef0b32abb5729/src/common/entity/domain_icon.ts#L138-L172
|
||||||
case "media_player":
|
case 'media_player':
|
||||||
switch (entity?.attributes.device_class) {
|
switch (entity?.attributes.device_class) {
|
||||||
case "speaker":
|
case 'speaker':
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case "playing":
|
case 'playing':
|
||||||
return 'mdi:speaker-play';
|
return 'mdi:speaker-play';
|
||||||
case "paused":
|
case 'paused':
|
||||||
return 'mdi:speaker-pause';
|
return 'mdi:speaker-pause';
|
||||||
case "off":
|
case 'off':
|
||||||
return 'mdi:speaker-off';
|
return 'mdi:speaker-off';
|
||||||
default:
|
default:
|
||||||
return 'mdi:speaker';
|
return 'mdi:speaker';
|
||||||
}
|
}
|
||||||
case "tv":
|
case 'tv':
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case "playing":
|
case 'playing':
|
||||||
return 'mdi:television-play';
|
return 'mdi:television-play';
|
||||||
case "paused":
|
case 'paused':
|
||||||
return 'mdi:television-pause';
|
return 'mdi:television-pause';
|
||||||
case "off":
|
case 'off':
|
||||||
return 'mdi:television-off';
|
return 'mdi:television-off';
|
||||||
default:
|
default:
|
||||||
return 'mdi:television';
|
return 'mdi:television';
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case "playing":
|
case 'playing':
|
||||||
case "paused":
|
case 'paused':
|
||||||
return 'mdi:cast-connected';
|
return 'mdi:cast-connected';
|
||||||
case "off":
|
case 'off':
|
||||||
return 'mdi:cast-off';
|
return 'mdi:cast-off';
|
||||||
default:
|
default:
|
||||||
return 'mdi:cast';
|
return 'mdi:cast';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
case 'switch':
|
case 'switch':
|
||||||
switch (entity?.attributes.device_class) {
|
switch (entity?.attributes.device_class) {
|
||||||
|
|||||||
Reference in New Issue
Block a user