fix dimmer scene state

This commit is contained in:
britea 2020-04-28 10:24:58 +02:00
parent 1d1fbe335e
commit c7c121182b

View file

@ -169,7 +169,7 @@ class Light extends Component {
return ( return (
<div> <div>
{this.props.stateOrDevice.kind === "dimmableLight" {this.props.device.kind === "dimmableLight"
? intensityLightView ? intensityLightView
: normalLightView} : normalLightView}
</div> </div>
@ -185,7 +185,13 @@ const mapStateToProps = (state, ownProps) => ({
return state.sceneStates[ownProps.id]; 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); const LightContainer = connect(mapStateToProps, RemoteService)(Light);