diff --git a/smart-hut/src/components/dashboard/devices/Light.js b/smart-hut/src/components/dashboard/devices/Light.js
index 32786ce..1415c5c 100644
--- a/smart-hut/src/components/dashboard/devices/Light.js
+++ b/smart-hut/src/components/dashboard/devices/Light.js
@@ -169,7 +169,7 @@ class Light extends Component {
return (
- {this.props.stateOrDevice.kind === "dimmableLight"
+ {this.props.device.kind === "dimmableLight"
? intensityLightView
: normalLightView}
@@ -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);