Format file

This commit is contained in:
Felipe Santos
2022-10-19 21:01:16 -03:00
parent e379067148
commit c0152ee0e5
+12 -12
View File
@@ -102,36 +102,36 @@ export function domainIcon(domain: string, entity?: HassEntity, state?: string):
}
// 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) {
case "speaker":
case 'speaker':
switch (state) {
case "playing":
case 'playing':
return 'mdi:speaker-play';
case "paused":
case 'paused':
return 'mdi:speaker-pause';
case "off":
case 'off':
return 'mdi:speaker-off';
default:
return 'mdi:speaker';
}
case "tv":
case 'tv':
switch (state) {
case "playing":
case 'playing':
return 'mdi:television-play';
case "paused":
case 'paused':
return 'mdi:television-pause';
case "off":
case 'off':
return 'mdi:television-off';
default:
return 'mdi:television';
}
default:
switch (state) {
case "playing":
case "paused":
case 'playing':
case 'paused':
return 'mdi:cast-connected';
case "off":
case 'off':
return 'mdi:cast-off';
default:
return 'mdi:cast';