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 (
<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);