mirror of
https://github.com/home-assistant/frontend.git
synced 2025-06-25 03:26:34 +00:00
13 lines
373 B
JavaScript
13 lines
373 B
JavaScript
/** Return an icon representing a cover state. */
|
|
import domainIcon from './domain_icon.js';
|
|
|
|
export default function coverIcon(state) {
|
|
var open = state.state && state.state !== 'closed';
|
|
switch (state.attributes.device_class) {
|
|
case 'garage':
|
|
return open ? 'mdi:garage-open' : 'mdi:garage';
|
|
default:
|
|
return domainIcon('cover', state.state);
|
|
}
|
|
}
|