import "@polymer/iron-flex-layout/iron-flex-layout-classes";
import "@polymer/paper-input/paper-input";
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import "../components/entity/state-info";
class StateCardInputText extends PolymerElement {
static get template() {
return html`
${this.stateInfoTemplate}
`;
}
static get stateInfoTemplate() {
return html`
`;
}
static get properties() {
return {
hass: Object,
inDialog: {
type: Boolean,
value: false,
},
stateObj: {
type: Object,
observer: "stateObjectChanged",
},
pattern: String,
value: String,
};
}
stateObjectChanged(newVal) {
this.value = newVal.state;
}
selectedValueChanged() {
if (this.value === this.stateObj.state) {
return;
}
this.hass.callService("input_text", "set_value", {
value: this.value,
entity_id: this.stateObj.entity_id,
});
}
stopPropagation(ev) {
ev.stopPropagation();
}
}
customElements.define("state-card-input_text", StateCardInputText);