Merge branch '86-hope-fix' into 'dev'

fix dimmer scene state

Closes #86

See merge request sa4-2020/the-sanmarinoes/frontend!101
This commit is contained in:
Andrea Brites Marto 2020-04-28 10:29:02 +02:00
commit 13f75e986e

View File

@ -169,7 +169,7 @@ class Light extends Component {
return (
<div>
{this.props.stateOrDevice.kind === "dimmableLight"
{this.props.device.kind === "dimmableLight"
? intensityLightView
: normalLightView}
</div>
@ -185,7 +185,13 @@ const mapStateToProps = (state, ownProps) => ({
return state.sceneStates[ownProps.id];
}
},
//device: state.devices[ownProps.id],
get device() {
if (state.active.activeTab === "Devices") {
return state.devices[ownProps.id];
} else {
return state.devices[state.sceneStates[ownProps.id].deviceId];
}
},
});
const LightContainer = connect(mapStateToProps, RemoteService)(Light);