diff --git a/src/more-infos/more-info-content.html b/src/more-infos/more-info-content.html index 1c9dc8b2fe..1e7a028c72 100644 --- a/src/more-infos/more-info-content.html +++ b/src/more-infos/more-info-content.html @@ -9,6 +9,7 @@ + + + + + + + Update + + + + View on GitHub + + + + + + + Updated On: + [[stateObj.attributes.date]] + + + + Release Notes: + [[stateObj.attributes.message]] + + + + + + Remote SHA: + [[stateObj.attributes.remote_sha]] + + + + Local SHA: + [[stateObj.attributes.local_sha]] + + + + diff --git a/src/more-infos/more-info-updater.js b/src/more-infos/more-info-updater.js new file mode 100644 index 0000000000..7c40f78c9a --- /dev/null +++ b/src/more-infos/more-info-updater.js @@ -0,0 +1,20 @@ +import { util } from 'home-assistant-js'; +import { serviceActions } from 'home-assistant-js'; + +export default Polymer({ + is: 'more-info-updater', + + properties: { + stateObj: { + type: Object, + }, + }, + + updateTapped: function(stateObj) { + serviceActions.callService('updater', 'update', {}) + }, + + linkTapped: function(stateObj) { + window.open(this.stateObj.attributes.link, '_blank'); + }, +}); diff --git a/src/util/domain-icon.js b/src/util/domain-icon.js index 312ce1b500..71d05adf26 100644 --- a/src/util/domain-icon.js +++ b/src/util/domain-icon.js @@ -51,6 +51,13 @@ export default function domainIcon(domain, state) { case 'scene': return 'social:pages'; + case 'updater': + if(state == "True") { + return 'icons:cloud-download'; + } else { + return 'icons:cloud-done'; + } + default: return "bookmark"; } diff --git a/src/util/state-more-info-type.js b/src/util/state-more-info-type.js index 6cf865e02a..4c6b2f8ead 100644 --- a/src/util/state-more-info-type.js +++ b/src/util/state-more-info-type.js @@ -1,5 +1,6 @@ const DOMAINS_WITH_MORE_INFO = [ - 'light', 'group', 'sun', 'configurator', 'thermostat', 'script', 'media_player', 'camera' + 'light', 'group', 'sun', 'configurator', 'thermostat', 'script', + 'media_player', 'camera', 'updater' ]; export default function stateMoreInfoType(state) {