Clear log entries if clear is pressed (#637)

* Clear log entries if clear is pressed

* Fix comparisons

* Clear entries instead of refresh
This commit is contained in:
Pierre Ståhl 2017-11-17 19:54:12 +01:00 committed by Paulus Schoutsen
parent 415b0b127f
commit 01fab1075e

View File

@ -248,6 +248,21 @@ class HaPanelDevInfo extends Polymer.Element {
};
}
ready() {
super.ready();
this.addEventListener('hass-service-called', ev => this.serviceCalled(ev));
}
serviceCalled(ev) {
// Check if this is for us
if (ev.detail.success && ev.detail.domain === 'system_log') {
// Do the right thing depending on service
if (ev.detail.service === 'clear') {
this.items = [];
}
}
}
connectedCallback() {
super.connectedCallback();
this.$.scrollable.dialogElement = this.$.showlog;