Allow marking YAML editor as read only (#11960)

This commit is contained in:
Paulus Schoutsen 2022-03-07 03:39:16 -08:00 committed by GitHub
parent bd20c15a55
commit ccb91e0b49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,6 +31,8 @@ export class HaYamlEditor extends LitElement {
@property() public label?: string; @property() public label?: string;
@property({ type: Boolean }) public readOnly = false;
@state() private _yaml = ""; @state() private _yaml = "";
public setValue(value): void { public setValue(value): void {
@ -61,6 +63,7 @@ export class HaYamlEditor extends LitElement {
<ha-code-editor <ha-code-editor
.hass=${this.hass} .hass=${this.hass}
.value=${this._yaml} .value=${this._yaml}
.readOnly=${this.readOnly}
mode="yaml" mode="yaml"
autocomplete-entities autocomplete-entities
.error=${this.isValid === false} .error=${this.isValid === false}