1
0
mirror of https://github.com/home-assistant/frontend.git synced 2025-12-24 20:55:49 +00:00
Files
frontend/js/panel-config/condition/template.js
Paulus Schoutsen 912969111f Move all of hassUtil to JS (#1153)
* Move all of hassUtil to JS

* Fix tests
2018-05-09 21:33:31 -04:00

31 lines
730 B
JavaScript

import { h, Component } from 'preact';
import { onChangeEvent } from '../../common/preact/event.js';
export default class TemplateCondition extends Component {
constructor() {
super();
this.onChange = onChangeEvent.bind(this, 'condition');
}
render({ condition, localize }) {
/* eslint-disable camelcase */
const { value_template } = condition;
return (
<div>
<paper-textarea
label={localize('ui.panel.config.automation.editor.conditions.type.template.value_template')}
name="value_template"
value={value_template}
onvalue-changed={this.onChange}
/>
</div>
);
}
}
TemplateCondition.defaultConfig = {
value_template: '',
};