From 5d9d077b4814ea03fa37c9e60948b260cc586227 Mon Sep 17 00:00:00 2001 From: britea Date: Wed, 25 Mar 2020 14:34:55 +0100 Subject: [PATCH] fixed dimmable light input --- smart-hut/src/components/dashboard/devices/Light.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/smart-hut/src/components/dashboard/devices/Light.js b/smart-hut/src/components/dashboard/devices/Light.js index 18787e5..917eba0 100644 --- a/smart-hut/src/components/dashboard/devices/Light.js +++ b/smart-hut/src/components/dashboard/devices/Light.js @@ -68,7 +68,10 @@ export default class Light extends Component { Math.round(newValue * 100) <= 1 ? 1 : Math.round(newValue * 100); call.deviceUpdate(this.props.device, "dimmableLight").then((res) => { if (res.status === 200) { - this.setState({ intensity: newValue }); + this.setState({ + intensity: + Math.round(newValue * 100) <= 1 ? 1 : Math.round(newValue * 100), + }); } }); };