Add option to hide the group card switch (#159)
* Add option to hide the group card switch * Changed hide_switch to control * lint * lint again * Pick state-card-display if control is hidden * fix permissions
This commit is contained in:
parent
2652823d35
commit
4697af1b0d
|
@ -110,7 +110,7 @@ Polymer({
|
|||
showGroupToggle: function (groupEntity, states) {
|
||||
var canToggleCount;
|
||||
|
||||
if (!groupEntity || !states ||
|
||||
if (!groupEntity || !states || groupEntity.attributes.control === 'hidden' ||
|
||||
(groupEntity.state !== 'on' && groupEntity.state !== 'off')) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -163,13 +163,12 @@ window.hassUtil.relativeTime.tests = [
|
|||
7, 'day',
|
||||
];
|
||||
|
||||
|
||||
window.hassUtil.stateCardType = function (hass, state) {
|
||||
if (state.state === 'unavailable') {
|
||||
return 'display';
|
||||
} else if (window.hassUtil.DOMAINS_WITH_CARD.indexOf(state.domain) !== -1) {
|
||||
return state.domain;
|
||||
} else if (window.hassUtil.canToggle(hass, state.entityId)) {
|
||||
} else if (window.hassUtil.canToggle(hass, state.entityId) && state.attributes.control !== 'hidden') {
|
||||
return 'toggle';
|
||||
}
|
||||
return 'display';
|
||||
|
|
Loading…
Reference in New Issue