mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-16 13:56:35 +00:00
Rollershutter UI tweaks
This commit is contained in:
parent
758560ad05
commit
41dbd6abc3
@ -20,9 +20,11 @@
|
|||||||
<div class='horizontal justified layout'>
|
<div class='horizontal justified layout'>
|
||||||
<state-info state-obj="[[stateObj]]"></state-info>
|
<state-info state-obj="[[stateObj]]"></state-info>
|
||||||
<div class='state'>
|
<div class='state'>
|
||||||
<paper-icon-button icon="mdi:arrow-up" on-tap='onMoveUpTap'></paper-icon-button>
|
<paper-icon-button icon="mdi:arrow-up" on-tap='onMoveUpTap'
|
||||||
<paper-icon-button icon="mdi:arrow-down" on-tap='onMoveDownTap'></paper-icon-button>
|
disabled='[[computeIsFullyClosed(stateObj)]]'></paper-icon-button>
|
||||||
<paper-icon-button icon="mdi:stop" on-tap='onStopTap'></paper-icon-button>
|
<paper-icon-button icon="mdi:stop" on-tap='onStopTap'></paper-icon-button>
|
||||||
|
<paper-icon-button icon="mdi:arrow-down" on-tap='onMoveDownTap'
|
||||||
|
disabled='[[computeIsFullyOpen(stateObj)]]'></paper-icon-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -13,6 +13,14 @@ export default new Polymer({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
computeIsFullyOpen(stateObj) {
|
||||||
|
return stateObj.attributes.current_position === 100;
|
||||||
|
},
|
||||||
|
|
||||||
|
computeIsFullyClosed(stateObj) {
|
||||||
|
return stateObj.attributes.current_position === 0;
|
||||||
|
},
|
||||||
|
|
||||||
onMoveUpTap() {
|
onMoveUpTap() {
|
||||||
serviceActions.callService('rollershutter', 'move_up',
|
serviceActions.callService('rollershutter', 'move_up',
|
||||||
{entity_id: this.stateObj.entityId});
|
{entity_id: this.stateObj.entityId});
|
||||||
|
@ -47,7 +47,7 @@ export default function domainIcon(domain, state) {
|
|||||||
return 'mdi:cloud-upload';
|
return 'mdi:cloud-upload';
|
||||||
|
|
||||||
case 'rollershutter':
|
case 'rollershutter':
|
||||||
return 'mdi:blinds';
|
return state && state === 'open' ? 'mdi:window-open' : 'mdi:window-closed';
|
||||||
|
|
||||||
case 'scene':
|
case 'scene':
|
||||||
return 'mdi:google-pages';
|
return 'mdi:google-pages';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user