missing config error fix

This commit is contained in:
htmltiger 2023-06-29 03:33:57 +01:00 committed by GitHub
parent 89b077bbae
commit bf6c3388b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,4 @@
console.info("Config Editor 4.6");
console.info("Config Editor 4.7");
const LitElement = window.LitElement || Object.getPrototypeOf(customElements.get("hui-masonry-view") );
const html = LitElement.prototype.html;
const css = LitElement.prototype.css;
@ -75,7 +75,7 @@ render(){
const targetver=4;
const hver=this._hass ? this._hass.states['config_editor.version']:{state:0};
const dlink=html`<a href="https://github.com/htmltiger/config-editor">download</a>`;
if(!hver.state){return html`<ha-card>Missing 'config_editor:' in configuration.yaml ${dlink}</ha-card>`;}
if(!hver || !hver.state){return html`<ha-card>Missing 'config_editor:' in configuration.yaml ${dlink}</ha-card>`;}
if(hver.state != targetver){return html`<ha-card>Please ${dlink} upgrade from ${hver.state} to ${targetver}</ha-card>`;}
if(this.fileList.length<1){
this.openedFile = this.localGet('Open')||'';
@ -207,7 +207,6 @@ saveKey(e) {
return true;
}
Toast(message, duration){
const e = new Event("hass-notification",
{bubbles: true, cancelable: false, composed: true});