mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-17 06:16:33 +00:00
Applying Updater suggested fixes
This commit is contained in:
parent
5a4295b27a
commit
2a437c7023
@ -6,4 +6,3 @@
|
|||||||
<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-updater.html">
|
|
||||||
|
@ -8,7 +8,6 @@ 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-updater');
|
|
||||||
|
|
||||||
export default Polymer({
|
export default Polymer({
|
||||||
is: 'state-card-content',
|
is: 'state-card-content',
|
||||||
|
@ -1,25 +0,0 @@
|
|||||||
<link rel="import" href="../../bower_components/polymer/polymer.html">
|
|
||||||
<link rel="import" href="../../bower_components/paper-button/paper-button.html">
|
|
||||||
|
|
||||||
<link rel="import" href="../components/state-info.html">
|
|
||||||
|
|
||||||
<dom-module id="state-card-updater">
|
|
||||||
<style>
|
|
||||||
.state {
|
|
||||||
margin-left: 16px;
|
|
||||||
text-transform: capitalize;
|
|
||||||
font-weight: 300;
|
|
||||||
font-size: 1.3rem;
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<div class='horizontal justified layout'>
|
|
||||||
<state-info state-obj="[[stateObj]]"></state-info>
|
|
||||||
<paper-button raised on-tap="buttonTapped">
|
|
||||||
Update
|
|
||||||
</paper-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</dom-module>
|
|
@ -1,20 +0,0 @@
|
|||||||
import { serviceActions } from 'home-assistant-js';
|
|
||||||
|
|
||||||
import Polymer from '../polymer';
|
|
||||||
|
|
||||||
require('../components/state-info');
|
|
||||||
|
|
||||||
export default Polymer({
|
|
||||||
is: 'state-card-updater',
|
|
||||||
|
|
||||||
properties: {
|
|
||||||
stateObj: {
|
|
||||||
type: Object,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
buttonTapped: function(ev) {
|
|
||||||
ev.stopPropagation();
|
|
||||||
serviceActions.callService('updater', 'update', {})
|
|
||||||
},
|
|
||||||
});
|
|
@ -22,19 +22,24 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class='layout vertical'>
|
<div class='layout vertical'>
|
||||||
|
|
||||||
<!-- GitHub Link -->
|
<div class='horizontal layout center'>
|
||||||
<div class='data-entry layout justified horizontal center' style="width:100%" id='setting'>
|
<paper-button raised class='centered link' raised on-tap="updateTapped">
|
||||||
<paper-button class='centered link' on-tap="linkTapped">
|
Update
|
||||||
|
</paper-button>
|
||||||
|
|
||||||
|
<paper-button raised class='centered link' on-tap="linkTapped">
|
||||||
View on GitHub
|
View on GitHub
|
||||||
</paper-button>
|
</paper-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class='divider'></div>
|
||||||
|
|
||||||
<div class='data-entry layout justified horizontal'>
|
<div class='data-entry layout justified horizontal'>
|
||||||
<div class='key'>Updated On:</div>
|
<div class='key'>Updated On:</div>
|
||||||
<div class='value'>[[stateObj.attributes.date]]</div>
|
<div class='value'>[[stateObj.attributes.date]]</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class='data-entry layout justified vertical'>
|
<div class='data-entry layout justified vertical' hidden='[[!stateObj.attributes.message]]'>
|
||||||
<div class='key'>Release Notes:</div>
|
<div class='key'>Release Notes:</div>
|
||||||
<div class='centered'>[[stateObj.attributes.message]]<br /></div>
|
<div class='centered'>[[stateObj.attributes.message]]<br /></div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { util } from 'home-assistant-js';
|
import { util } from 'home-assistant-js';
|
||||||
|
import { serviceActions } from 'home-assistant-js';
|
||||||
|
|
||||||
export default Polymer({
|
export default Polymer({
|
||||||
is: 'more-info-updater',
|
is: 'more-info-updater',
|
||||||
@ -9,6 +10,10 @@ export default Polymer({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
updateTapped: function(stateObj) {
|
||||||
|
serviceActions.callService('updater', 'update', {})
|
||||||
|
},
|
||||||
|
|
||||||
linkTapped: function(stateObj) {
|
linkTapped: function(stateObj) {
|
||||||
window.open(this.stateObj.attributes.link, '_blank');
|
window.open(this.stateObj.attributes.link, '_blank');
|
||||||
},
|
},
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { reactor, serviceGetters } from 'home-assistant-js';
|
import { reactor, serviceGetters } from 'home-assistant-js';
|
||||||
|
|
||||||
const DOMAINS_WITH_CARD = [
|
const DOMAINS_WITH_CARD = [
|
||||||
'thermostat', 'configurator', 'scene', 'media_player', 'updater'];
|
'thermostat', 'configurator', 'scene', 'media_player'];
|
||||||
|
|
||||||
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