From b25b31922824d406cd0a6885dd7ba072f5d45dc3 Mon Sep 17 00:00:00 2001 From: britea Date: Sat, 23 May 2020 16:19:13 +0200 Subject: [PATCH] fixed thermostat trigger --- smart-hut/src/components/dashboard/AutomationCreationModal.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/smart-hut/src/components/dashboard/AutomationCreationModal.js b/smart-hut/src/components/dashboard/AutomationCreationModal.js index 1e2b302..1cad28d 100644 --- a/smart-hut/src/components/dashboard/AutomationCreationModal.js +++ b/smart-hut/src/components/dashboard/AutomationCreationModal.js @@ -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 { ); })}