Bugfix frontend: show no state message when no states

pull/172/head
Paulus Schoutsen 2015-06-11 00:31:12 -07:00
parent cac1c0d415
commit 58f4ab4e67
4 changed files with 24 additions and 12 deletions

View File

@ -1,2 +1,2 @@
""" DO NOT MODIFY. Auto-generated by build_frontend script """
VERSION = "d0b5982b1bc41a96b8a4f49aaa92af5d"
VERSION = "ddf42f54c15daf472d4c8641fab8d418"

View File

@ -22445,8 +22445,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
background-color: #fff;
border-radius: 2px;
box-shadow: rgba(0, 0, 0, 0.098) 0px 2px 4px, rgba(0, 0, 0, 0.098) 0px 0px 3px;
padding: 16px;
margin: 16px auto;
padding: 0 16px 8px;
margin: 16px;
}
</style>
@ -22457,9 +22457,15 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<state-card class="state-card" state-obj="[[item]]"></state-card>
</template>
<template if="[[computeEmptyStates(states)]]">
<template is="dom-if" if="[[computeEmptyStates(states)]]">
<div class="no-states-content">
<content></content>
<h3>Hi there!</h3>
<p>
It looks like we have nothing to show you right now. It could be that we have not yet discovered all your devices but it is more likely that you have not configured Home Assistant yet.
</p>
<p>
Please see the <a href="https://home-assistant.io/getting-started/" target="_blank">Getting Started</a> section on how to setup your devices.
</p>
</div>
</template>
@ -25999,7 +26005,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
},
computeHidePowerButton: function(isOff, supportsTurnOn, supportsTurnOff) {
return isOff && !supportsTurnOn || !isOff && supportsTurnOff;
return isOff ? !supportsTurnOn : !supportsTurnOff;
},
handleTogglePower: function() {

View File

@ -5,10 +5,10 @@
<dom-module id="state-card-scene">
<template>
<template is='dom-if' if=[[allowToggle]]>
<template is='dom-if' if='[[allowToggle]]'>
<state-card-toggle state-obj="[[stateObj]]"></state-card-toggle>
</template>
<template is='dom-if' if=[[!allowToggle]]>
<template is='dom-if' if='[[!allowToggle]]'>
<state-card-display state-obj="[[stateObj]]"></state-card-display>
</template>
</template>

View File

@ -32,8 +32,8 @@
background-color: #fff;
border-radius: 2px;
box-shadow: rgba(0, 0, 0, 0.098) 0px 2px 4px, rgba(0, 0, 0, 0.098) 0px 0px 3px;
padding: 16px;
margin: 16px auto;
padding: 0 16px 8px;
margin: 16px;
}
</style>
@ -44,9 +44,15 @@
<state-card class="state-card" state-obj="[[item]]"></state-card>
</template>
<template if="[[computeEmptyStates(states)]]">
<template is='dom-if' if="[[computeEmptyStates(states)]]">
<div class='no-states-content'>
<content></content>
<h3>Hi there!</h3>
<p>
It looks like we have nothing to show you right now. It could be that we have not yet discovered all your devices but it is more likely that you have not configured Home Assistant yet.
</p>
<p>
Please see the <a href='https://home-assistant.io/getting-started/' target='_blank'>Getting Started</a> section on how to setup your devices.
</p>
</div>
</template>