mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-12 03:46:34 +00:00
Add automation more info
This commit is contained in:
parent
670ba0292b
commit
ffce92d026
@ -48,7 +48,7 @@ Polymer({
|
|||||||
updateRelative: function () {
|
updateRelative: function () {
|
||||||
var root = Polymer.dom(this);
|
var root = Polymer.dom(this);
|
||||||
root.innerHTML = this.parsedDateTime ?
|
root.innerHTML = this.parsedDateTime ?
|
||||||
window.hassUtil.relativeTime(this.parsedDateTime) : '';
|
window.hassUtil.relativeTime(this.parsedDateTime) : 'never';
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
50
src/more-infos/more-info-automation.html
Normal file
50
src/more-infos/more-info-automation.html
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
<link rel="import" href="../../bower_components/polymer/polymer.html">
|
||||||
|
|
||||||
|
<link rel="import" href="../../bower_components/iron-flex-layout/iron-flex-layout-classes.html">
|
||||||
|
|
||||||
|
<link rel="import" href="../../bower_components/paper-button/paper-button.html">
|
||||||
|
|
||||||
|
<link rel="import" href="../components/ha-relative-time.html">
|
||||||
|
|
||||||
|
<dom-module id="more-info-automation">
|
||||||
|
<template>
|
||||||
|
<style>
|
||||||
|
paper-button {
|
||||||
|
color: var(--default-primary-color);
|
||||||
|
font-weight: 500;
|
||||||
|
top: 3px;
|
||||||
|
height: 37px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Last triggered:
|
||||||
|
<ha-relative-time datetime="[[stateObj.attributes.last_triggered]]"></ha-relative-time>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<paper-button on-tap='handleTriggerTapped'>TRIGGER</paper-button>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
</dom-module>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
Polymer({
|
||||||
|
is: 'more-info-automation',
|
||||||
|
|
||||||
|
properties: {
|
||||||
|
hass: {
|
||||||
|
type: Object,
|
||||||
|
},
|
||||||
|
|
||||||
|
stateObj: {
|
||||||
|
type: Object,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
handleTriggerTapped: function () {
|
||||||
|
this.hass.serviceActions.callService('automation', 'trigger', {
|
||||||
|
entity_id: this.stateObj.entityId,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
@ -1,5 +1,6 @@
|
|||||||
<link rel='import' href='../../bower_components/polymer/polymer.html'>
|
<link rel='import' href='../../bower_components/polymer/polymer.html'>
|
||||||
|
|
||||||
|
<link rel='import' href='more-info-automation.html'>
|
||||||
<link rel='import' href='more-info-climate.html'>
|
<link rel='import' href='more-info-climate.html'>
|
||||||
<link rel='import' href='more-info-cover.html'>
|
<link rel='import' href='more-info-cover.html'>
|
||||||
<link rel='import' href='more-info-default.html'>
|
<link rel='import' href='more-info-default.html'>
|
||||||
|
@ -28,7 +28,7 @@ window.hassUtil.DOMAINS_WITH_CARD = [
|
|||||||
window.hassUtil.DOMAINS_WITH_MORE_INFO = [
|
window.hassUtil.DOMAINS_WITH_MORE_INFO = [
|
||||||
'light', 'group', 'sun', 'climate', 'configurator', 'cover', 'thermostat',
|
'light', 'group', 'sun', 'climate', 'configurator', 'cover', 'thermostat',
|
||||||
'script', 'media_player', 'camera', 'updater', 'alarm_control_panel',
|
'script', 'media_player', 'camera', 'updater', 'alarm_control_panel',
|
||||||
'lock', 'hvac',
|
'lock', 'hvac', 'automation',
|
||||||
];
|
];
|
||||||
|
|
||||||
window.hassUtil.DOMAINS_WITH_NO_HISTORY = ['camera', 'configurator', 'scene'];
|
window.hassUtil.DOMAINS_WITH_NO_HISTORY = ['camera', 'configurator', 'scene'];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user