mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-15 05:16:34 +00:00
Rename domain-card -> entities-card
This commit is contained in:
parent
70b04333f1
commit
1fb3f2bbf4
@ -4,7 +4,7 @@
|
|||||||
<link rel='import' href='../components/entity/ha-entity-toggle.html'>
|
<link rel='import' href='../components/entity/ha-entity-toggle.html'>
|
||||||
<link rel='import' href='../state-summary/state-card-content.html'>
|
<link rel='import' href='../state-summary/state-card-content.html'>
|
||||||
|
|
||||||
<dom-module id='ha-domain-card'>
|
<dom-module id='ha-entities-card'>
|
||||||
<style>
|
<style>
|
||||||
.states {
|
.states {
|
||||||
padding-bottom: 16px;
|
padding-bottom: 16px;
|
||||||
@ -29,7 +29,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<ha-card>
|
<ha-card>
|
||||||
<div class='header horizontal layout center'>
|
<div class='header horizontal layout center'>
|
||||||
<div class='flex name'>[[computeDomainTitle(domain)]]</div>
|
<div class='flex name'>[[computeTitle(states, groupEntity)]]</div>
|
||||||
<template is='dom-if' if='[[showGroupToggle(groupEntity, states)]]'>
|
<template is='dom-if' if='[[showGroupToggle(groupEntity, states)]]'>
|
||||||
<ha-entity-toggle state-obj='[[groupEntity]]'></ha-entity-toggle>
|
<ha-entity-toggle state-obj='[[groupEntity]]'></ha-entity-toggle>
|
||||||
</template>
|
</template>
|
@ -9,12 +9,9 @@ require('../state-summary/state-card-content');
|
|||||||
const { moreInfoActions } = hass;
|
const { moreInfoActions } = hass;
|
||||||
|
|
||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
is: 'ha-domain-card',
|
is: 'ha-entities-card',
|
||||||
|
|
||||||
properties: {
|
properties: {
|
||||||
domain: {
|
|
||||||
type: String,
|
|
||||||
},
|
|
||||||
states: {
|
states: {
|
||||||
type: Array,
|
type: Array,
|
||||||
},
|
},
|
||||||
@ -23,8 +20,9 @@ export default new Polymer({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
computeDomainTitle(domain) {
|
computeTitle(states, groupEntity) {
|
||||||
return domain.replace(/_/g, ' ');
|
return groupEntity ? groupEntity.entityDisplay :
|
||||||
|
states[0].domain.replace(/_/g, ' ');
|
||||||
},
|
},
|
||||||
|
|
||||||
entityTapped(ev) {
|
entityTapped(ev) {
|
||||||
@ -43,6 +41,6 @@ export default new Polymer({
|
|||||||
}
|
}
|
||||||
|
|
||||||
// only show if we can toggle 2+ entities in group
|
// only show if we can toggle 2+ entities in group
|
||||||
return states.reduce((sum, state) => sum + canToggle(state.entityId), 0) > 1;
|
return states.reduce((sum, state) => sum + canToggle(state.entityId)) > 1;
|
||||||
},
|
},
|
||||||
});
|
});
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<link rel="import" href="./ha-demo-badge.html">
|
<link rel="import" href="./ha-demo-badge.html">
|
||||||
<link rel="import" href="../cards/ha-badges-card.html">
|
<link rel="import" href="../cards/ha-badges-card.html">
|
||||||
<link rel="import" href="../cards/ha-domain-card.html">
|
<link rel="import" href="../cards/ha-entities-card.html">
|
||||||
<link rel="import" href="../cards/ha-introduction-card.html">
|
<link rel="import" href="../cards/ha-introduction-card.html">
|
||||||
|
|
||||||
<dom-module id="ha-cards">
|
<dom-module id="ha-cards">
|
||||||
@ -77,10 +77,10 @@
|
|||||||
</template>
|
</template>
|
||||||
<template is='dom-repeat' items='[[column]]' as='domain'>
|
<template is='dom-repeat' items='[[column]]' as='domain'>
|
||||||
<div class='zone-card'>
|
<div class='zone-card'>
|
||||||
<ha-domain-card domain='[[domain]]'
|
<ha-entities-card
|
||||||
states='[[computeStatesOfCard(cards, domain)]]'
|
states='[[computeStatesOfCard(cards, domain)]]'
|
||||||
group-entity='[[computeGroupEntityOfCard(cards, domain)]]'
|
group-entity='[[computeGroupEntityOfCard(cards, domain)]]'
|
||||||
></ha-domain-card>
|
></ha-entities-card>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
@ -3,7 +3,7 @@ import hass from '../util/home-assistant-js-instance';
|
|||||||
|
|
||||||
require('.//ha-demo-badge');
|
require('.//ha-demo-badge');
|
||||||
require('../cards/ha-badges-card');
|
require('../cards/ha-badges-card');
|
||||||
require('../cards/ha-domain-card');
|
require('../cards/ha-entities-card');
|
||||||
require('../cards/ha-introduction-card');
|
require('../cards/ha-introduction-card');
|
||||||
|
|
||||||
const { util } = hass;
|
const { util } = hass;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user