mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-08 09:56:36 +00:00
Add rollershutter UI
This commit is contained in:
parent
c130933f45
commit
04a7ce241c
@ -6,3 +6,4 @@
|
|||||||
<link rel="import" href="state-card-configurator.html">
|
<link rel="import" href="state-card-configurator.html">
|
||||||
<link rel="import" href="state-card-scene.html">
|
<link rel="import" href="state-card-scene.html">
|
||||||
<link rel="import" href="state-card-media_player.html">
|
<link rel="import" href="state-card-media_player.html">
|
||||||
|
<link rel="import" href="state-card-rollershutter.html">
|
||||||
|
@ -8,6 +8,7 @@ require('./state-card-thermostat');
|
|||||||
require('./state-card-configurator');
|
require('./state-card-configurator');
|
||||||
require('./state-card-scene');
|
require('./state-card-scene');
|
||||||
require('./state-card-media_player');
|
require('./state-card-media_player');
|
||||||
|
require('./state-card-rollershutter');
|
||||||
|
|
||||||
export default new Polymer({
|
export default new Polymer({
|
||||||
is: 'state-card-content',
|
is: 'state-card-content',
|
||||||
|
28
src/state-summary/state-card-rollershutter.html
Normal file
28
src/state-summary/state-card-rollershutter.html
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<link rel="import" href="../../bower_components/polymer/polymer.html">
|
||||||
|
<link rel="import" href="../../bower_components/paper-icon-button/paper-icon-button.html">
|
||||||
|
|
||||||
|
<link rel="import" href="../components/state-info.html">
|
||||||
|
|
||||||
|
<dom-module id="state-card-rollershutter">
|
||||||
|
<style>
|
||||||
|
:host {
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.state {
|
||||||
|
margin-left: 16px;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
<template>
|
||||||
|
<div class='horizontal justified layout'>
|
||||||
|
<state-info state-obj="[[stateObj]]"></state-info>
|
||||||
|
<div class='state'>
|
||||||
|
<paper-icon-button icon="mdi:arrow-up" on-tap='onMoveUpTap'></paper-icon-button>
|
||||||
|
<paper-icon-button icon="mdi:arrow-down" on-tap='onMoveDownTap'></paper-icon-button>
|
||||||
|
<paper-icon-button icon="mdi:stop" on-tap='onStopTap'></paper-icon-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</dom-module>
|
30
src/state-summary/state-card-rollershutter.js
Normal file
30
src/state-summary/state-card-rollershutter.js
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
import { serviceActions } from '../util/home-assistant-js-instance';
|
||||||
|
|
||||||
|
import Polymer from '../polymer';
|
||||||
|
|
||||||
|
require('../components/state-info');
|
||||||
|
|
||||||
|
export default new Polymer({
|
||||||
|
is: 'state-card-rollershutter',
|
||||||
|
|
||||||
|
properties: {
|
||||||
|
stateObj: {
|
||||||
|
type: Object,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
onMoveUpTap() {
|
||||||
|
serviceActions.callService('rollershutter', 'move_up',
|
||||||
|
{entity_id: this.stateObj.entityId});
|
||||||
|
},
|
||||||
|
|
||||||
|
onMoveDownTap() {
|
||||||
|
serviceActions.callService('rollershutter', 'move_down',
|
||||||
|
{entity_id: this.stateObj.entityId});
|
||||||
|
},
|
||||||
|
|
||||||
|
onStopTap() {
|
||||||
|
serviceActions.callService('rollershutter', 'stop',
|
||||||
|
{entity_id: this.stateObj.entityId});
|
||||||
|
},
|
||||||
|
});
|
@ -46,6 +46,9 @@ export default function domainIcon(domain, state) {
|
|||||||
case 'updater':
|
case 'updater':
|
||||||
return 'mdi:cloud-upload';
|
return 'mdi:cloud-upload';
|
||||||
|
|
||||||
|
case 'rollershutter':
|
||||||
|
return 'mdi:blinds';
|
||||||
|
|
||||||
case 'scene':
|
case 'scene':
|
||||||
return 'mdi:google-pages';
|
return 'mdi:google-pages';
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import canToggle from './can-toggle';
|
import canToggle from './can-toggle';
|
||||||
|
|
||||||
const DOMAINS_WITH_CARD = [
|
const DOMAINS_WITH_CARD = [
|
||||||
'thermostat', 'configurator', 'scene', 'media_player'];
|
'thermostat', 'configurator', 'scene', 'media_player', 'rollershutter'];
|
||||||
|
|
||||||
export default function stateCardType(state) {
|
export default function stateCardType(state) {
|
||||||
if (DOMAINS_WITH_CARD.indexOf(state.domain) !== -1) {
|
if (DOMAINS_WITH_CARD.indexOf(state.domain) !== -1) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user