mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 09:16:38 +00:00
commit
99af263595
@ -43,6 +43,8 @@ export default new Polymer({
|
||||
return 'green';
|
||||
case 'script':
|
||||
return state.state === 'on' ? 'blue' : 'grey';
|
||||
case 'updater':
|
||||
return 'blue';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
@ -51,6 +53,7 @@ export default new Polymer({
|
||||
computeValue(state) {
|
||||
switch (state.domain) {
|
||||
case 'device_tracker':
|
||||
case 'updater':
|
||||
case 'sun':
|
||||
case 'scene':
|
||||
case 'script':
|
||||
@ -79,6 +82,8 @@ export default new Polymer({
|
||||
case 'scene':
|
||||
case 'script':
|
||||
return domainIcon(state.domain, state.state);
|
||||
case 'updater':
|
||||
return domainIcon(state.domain);
|
||||
case 'sun':
|
||||
return state.state === 'above_horizon' ?
|
||||
domainIcon(state.domain) : 'mdi:brightness-3';
|
||||
|
@ -10,13 +10,14 @@ const PRIORITY = {
|
||||
configurator: -20,
|
||||
group: -10,
|
||||
a: -1,
|
||||
sun: 0,
|
||||
device_tracker: 1,
|
||||
alarm_control_panel: 2,
|
||||
camera: 3,
|
||||
sensor: 4,
|
||||
scene: 5,
|
||||
script: 6,
|
||||
updater: 0,
|
||||
sun: 1,
|
||||
device_tracker: 2,
|
||||
alarm_control_panel: 3,
|
||||
camera: 4,
|
||||
sensor: 5,
|
||||
scene: 6,
|
||||
script: 7,
|
||||
thermostat: 40,
|
||||
media_player: 50,
|
||||
};
|
||||
|
@ -1,20 +1,7 @@
|
||||
<link rel="import" href="../../bower_components/polymer/polymer.html">
|
||||
<link rel="import" href="../../bower_components/paper-button/paper-button.html">
|
||||
|
||||
<dom-module id="more-info-updater">
|
||||
<style>
|
||||
.data-entry .value {
|
||||
max-width: 200px;
|
||||
}
|
||||
.center {
|
||||
text-align: center;
|
||||
}
|
||||
.centered {
|
||||
margin: auto;
|
||||
}
|
||||
.divider {
|
||||
padding: 5px;
|
||||
}
|
||||
.link {
|
||||
color: #03A9F4;
|
||||
}
|
||||
@ -22,39 +9,8 @@
|
||||
<template>
|
||||
<div class='layout vertical'>
|
||||
|
||||
<div class='horizontal layout center'>
|
||||
<paper-button raised class='centered link' raised on-tap="updateTapped">
|
||||
Update
|
||||
</paper-button>
|
||||
<a class='link' href='https://home-assistant.io/getting-started/' target='_blank'>Update Instructions</a>
|
||||
|
||||
<paper-button raised class='centered link' on-tap="linkTapped">
|
||||
View on GitHub
|
||||
</paper-button>
|
||||
</div>
|
||||
|
||||
<div class='divider'></div>
|
||||
|
||||
<div class='data-entry layout justified horizontal'>
|
||||
<div class='key'>Updated On:</div>
|
||||
<div class='value'>[[stateObj.attributes.date]]</div>
|
||||
</div>
|
||||
|
||||
<div class='data-entry layout justified vertical' hidden='[[!stateObj.attributes.message]]'>
|
||||
<div class='key'>Release Notes:</div>
|
||||
<div class='centered'>[[stateObj.attributes.message]]<br /></div>
|
||||
</div>
|
||||
|
||||
<div class='divider'></div>
|
||||
|
||||
<div class='data-entry layout justified vertical'>
|
||||
<div class='key'>Remote SHA:</div>
|
||||
<div class='centered'>[[stateObj.attributes.remote_sha]]<br /></div>
|
||||
</div>
|
||||
|
||||
<div class='data-entry layout justified vertical'>
|
||||
<div class='key'>Local SHA:</div>
|
||||
<div class='centered'>[[stateObj.attributes.local_sha]]<br /></div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</dom-module>
|
||||
|
@ -1,20 +1,8 @@
|
||||
import Polymer from '../polymer';
|
||||
import { serviceActions } from '../util/home-assistant-js-instance';
|
||||
|
||||
export default new Polymer({
|
||||
is: 'more-info-updater',
|
||||
|
||||
properties: {
|
||||
stateObj: {
|
||||
type: Object,
|
||||
},
|
||||
},
|
||||
|
||||
updateTapped() {
|
||||
serviceActions.callService('updater', 'update', {});
|
||||
},
|
||||
|
||||
linkTapped() {
|
||||
window.open(this.stateObj.attributes.link, '_blank');
|
||||
},
|
||||
});
|
||||
|
@ -37,6 +37,9 @@ export default function domainIcon(domain, state) {
|
||||
case 'notify':
|
||||
return 'mdi:comment-alert';
|
||||
|
||||
case 'updater':
|
||||
return 'mdi:cloud-upload';
|
||||
|
||||
case 'sun':
|
||||
return 'mdi:white-balance-sunny';
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user