diff --git a/smart-hut/src/components/SceneModal.js b/smart-hut/src/components/SceneModal.js
index 9183a58..cffa062 100644
--- a/smart-hut/src/components/SceneModal.js
+++ b/smart-hut/src/components/SceneModal.js
@@ -17,8 +17,6 @@ class SceneModal extends Component {
constructor(props) {
super(props);
this.state = this.initialState;
- this.setInitialState();
-
this.addSceneModal = this.addSceneModal.bind(this);
this.modifySceneModal = this.modifySceneModal.bind(this);
this.deleteScene = this.deleteScene.bind(this);
diff --git a/smart-hut/src/components/dashboard/DevicePanel.js b/smart-hut/src/components/dashboard/DevicePanel.js
index 4dd74e2..15206b8 100644
--- a/smart-hut/src/components/dashboard/DevicePanel.js
+++ b/smart-hut/src/components/dashboard/DevicePanel.js
@@ -26,7 +26,7 @@ class DevicePanel extends Component {
return (
{this.props.devices.map((e, i) => {
- return ;
+ return ;
})}
{!this.props.isActiveRoomHome ? (
diff --git a/smart-hut/src/components/dashboard/NewSceneDevice.js b/smart-hut/src/components/dashboard/NewSceneDevice.js
index 9b76044..41bf4fd 100644
--- a/smart-hut/src/components/dashboard/NewSceneDevice.js
+++ b/smart-hut/src/components/dashboard/NewSceneDevice.js
@@ -98,7 +98,14 @@ class NewSceneDevice extends Component {
open={this.state.openModal}
onClose={this.resetState}
trigger={
-
+
}
diff --git a/smart-hut/src/components/dashboard/ScenesPanel.js b/smart-hut/src/components/dashboard/ScenesPanel.js
index d8bcfd5..8401f1a 100644
--- a/smart-hut/src/components/dashboard/ScenesPanel.js
+++ b/smart-hut/src/components/dashboard/ScenesPanel.js
@@ -3,7 +3,7 @@ import { connect } from "react-redux";
import { RemoteService } from "../../remote";
import Device from "./devices/Device";
import NewSceneDevice from "./NewSceneDevice";
-import { Grid, Button } from "semantic-ui-react";
+import { Grid, Button, Card, Segment, Header } from "semantic-ui-react";
class ScenesPanel extends Component {
constructor(props) {
@@ -13,38 +13,44 @@ class ScenesPanel extends Component {
applyScene() {
console.log(this.props.activeScene);
- this.props.sceneApply(this.props.activeScene).then(() => {
- alert("Scene applied.");
- });
+ this.props
+ .sceneApply(this.props.activeScene)
+ .then(() => {
+ alert("Scene applied.");
+ })
+ .catch(console.error);
}
render() {
return (
-
+
{!this.props.isActiveDefaultScene ? (
-
-
-
- ) : null}
- {!this.props.isActiveDefaultScene
- ? this.props.sceneStates.map((e, i) => {
- return (
-
-
-
- );
- })
- : null}
- {!this.props.isActiveDefaultScene ? (
-
-
-
+
+
+
+ Add devices - Apply Scene
+
+
+
+
+
+
+
+
+
+
+
) : (
Welcome to the Scene View, you add a Scene
)}
-
+ {!this.props.isActiveDefaultScene
+ ? this.props.sceneStates.map((e, i) => {
+ return ;
+ })
+ : null}
+
);
}
}
diff --git a/smart-hut/src/components/dashboard/devices/Device.js b/smart-hut/src/components/dashboard/devices/Device.js
index 7da9395..6a251b3 100644
--- a/smart-hut/src/components/dashboard/devices/Device.js
+++ b/smart-hut/src/components/dashboard/devices/Device.js
@@ -41,8 +41,8 @@ class Device extends React.Component {
}
deleteState() {
- //console.log("alpaca "+this.props);
- this.props.deleteState(this.props.id, this.props.type);
+ console.log("alpaca ", this.props);
+ this.props.deleteState(this.props.id, this.props.stateOrDevice.kind);
}
renderDeviceComponent() {
@@ -136,7 +136,7 @@ class Device extends React.Component {
stateDescription() {
return (
-