fix dimmer scene state
This commit is contained in:
parent
1d1fbe335e
commit
c7c121182b
1 changed files with 8 additions and 2 deletions
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue