diff --git a/js/editor/automation.js b/js/editor/automation.js index 58c3f64290..9234b34967 100644 --- a/js/editor/automation.js +++ b/js/editor/automation.js @@ -1,6 +1,7 @@ import { h, Component } from 'preact'; import Trigger from './trigger'; +import Condition from './condition'; import Script from './script'; export default class Automation extends Component { @@ -9,6 +10,7 @@ export default class Automation extends Component { this.onChange = this.onChange.bind(this); this.triggerChanged = this.triggerChanged.bind(this); + this.conditionChanged = this.conditionChanged.bind(this); this.actionChanged = this.actionChanged.bind(this); } @@ -26,6 +28,13 @@ export default class Automation extends Component { }); } + conditionChanged(condition) { + this.props.onChange({ + ...this.props.automation, + condition, + }); + } + actionChanged(action) { this.props.onChange({ ...this.props.automation, @@ -83,12 +92,7 @@ export default class Automation extends Component { Learn more about conditions.
-{JSON.stringify(condition, null, 2)}-
{JSON.stringify(condition, null, 2)}+
For: {JSON.stringify(cndFor, null, 2)}} +
{JSON.stringify(action, null, 2)}+
{JSON.stringify(action, null, 2)}-
{JSON.stringify(trigger, null, 2)}+
{JSON.stringify(trigger, null, 2)}-