Merge branch '118-fix-thermostat-trigger' into 'dev'

fixed thermostat trigger

Closes #118

See merge request sa4-2020/the-sanmarinoes/frontend!155
This commit is contained in:
Andrea Brites Marto 2020-05-23 16:23:33 +02:00
commit 0d03c420ee

View file

@ -85,7 +85,7 @@ const CreateTrigger = (props) => {
const onChange = (e, val) => {
props.inputChange(val);
setActiveOperand(hasOperand.has(props.devices[val.value].kind));
setActiveThermostat(props.devices[val.value].kind === 'thermostat');
setActiveThermostat(props.devices[val.value].kind === 'thermostat' && props.condition);
if (operandsRef.current) operandsRef.current.setValue('');
if (valuesRef.current) valuesRef.current.inputRef.current.valueAsNumber = undefined;
};
@ -773,6 +773,7 @@ class AutomationSaveModal extends Component {
);
})}
<CreateTrigger
condition
devices={this.props.devices}
inputChange={this.onInputChangeCondition}
/>