From b56b9a8260ddbf0aa49e78b67e522ea0489b76f1 Mon Sep 17 00:00:00 2001 From: Jacob Salvi Date: Sat, 25 Apr 2020 15:43:27 +0200 Subject: [PATCH] added updateState to store --- smart-hut/src/components/dashboard/devices/Light.js | 2 +- smart-hut/src/components/dashboard/devices/Thermostats.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/smart-hut/src/components/dashboard/devices/Light.js b/smart-hut/src/components/dashboard/devices/Light.js index b8d4acf..1dfb41e 100644 --- a/smart-hut/src/components/dashboard/devices/Light.js +++ b/smart-hut/src/components/dashboard/devices/Light.js @@ -99,7 +99,7 @@ class Light extends Component { .saveDevice({ ...this.props.device, intensity }) .catch((err) => console.error("regular light update error", err)); }else{ - this.props.updateState({ ...this.props.device, on },this.props.type); + this.props.updateState({ ...this.props.device, intensity },this.props.type); } }; diff --git a/smart-hut/src/components/dashboard/devices/Thermostats.js b/smart-hut/src/components/dashboard/devices/Thermostats.js index b08f2eb..f65aa2a 100644 --- a/smart-hut/src/components/dashboard/devices/Thermostats.js +++ b/smart-hut/src/components/dashboard/devices/Thermostats.js @@ -68,7 +68,7 @@ class Thermostats extends Component { .saveDevice({ ...this.props.device, turnOn }) .catch((err) => console.error("thermostat update error", err)); }else{ - this.props.updateState({ ...this.props.device, on },this.props.type); + this.props.updateState({ ...this.props.device, turnOn },this.props.type); } } @@ -90,7 +90,7 @@ class Thermostats extends Component { .saveDevice({ ...this.props.device, targetTemperature }) .catch((err) => console.error("thermostat update error", err)); }else{ - this.props.updateState({ ...this.props.device, on },this.props.type); + this.props.updateState({ ...this.props.device, targetTemperature },this.props.type); } } @@ -118,7 +118,7 @@ class Thermostats extends Component { .saveDevice({ ...this.props.device, internalSensorTemperature }) .catch((err) => console.error("thermostat update error", err)); }else{ - this.props.updateState({ ...this.props.device, on },this.props.type); + this.props.updateState({ ...this.props.device, internalSensorTemperature },this.props.type); } }