Merge branch '64-fix-dimmable-light-input' into 'dev'

fixed dimmable light input

Closes #64

See merge request sa4-2020/the-sanmarinoes/frontend!67
This commit is contained in:
Matteo Omenetti 2020-03-25 14:37:51 +01:00
commit 8952aea4bb

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