fixed dimmable light input

This commit is contained in:
britea 2020-03-25 14:34:55 +01:00
parent 228ada3305
commit 5d9d077b48

View file

@ -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),
});
}
});
};