Treat default_view as special only with view:true (#251)

This commit is contained in:
Andrey 2017-04-03 03:38:50 +03:00 committed by Paulus Schoutsen
parent 9aa188079e
commit e4fe4ec812

View File

@ -175,7 +175,7 @@ Polymer({
viewStates: { viewStates: {
type: Object, type: Object,
computed: 'computeViewStates(currentView, hass)', computed: 'computeViewStates(currentView, hass, defaultView)',
}, },
}, },
@ -293,7 +293,7 @@ Polymer({
Will make sure we always show entities from ALWAYS_SHOW_DOMAINS domains. Will make sure we always show entities from ALWAYS_SHOW_DOMAINS domains.
*/ */
computeViewStates: function (currentView, hass) { computeViewStates: function (currentView, hass, defaultView) {
var i; var i;
var entityId; var entityId;
var state; var state;
@ -301,7 +301,7 @@ Polymer({
var entityIds = Object.keys(hass.states); var entityIds = Object.keys(hass.states);
// If we base off all entities, only have to filter out hidden // If we base off all entities, only have to filter out hidden
if (!currentView && !(this.DEFAULT_VIEW_ENTITY_ID in hass.states)) { if (!currentView && !defaultView) {
states = {}; states = {};
for (i = 0; i < entityIds.length; i++) { for (i = 0; i < entityIds.length; i++) {
entityId = entityIds[i]; entityId = entityIds[i];