diff --git a/smart-hut/src/App.js b/smart-hut/src/App.js
index cadc1db..003ee6c 100644
--- a/smart-hut/src/App.js
+++ b/smart-hut/src/App.js
@@ -27,6 +27,7 @@ class App extends Component {
super(props);
let loggedIn = false;
+ let token = undefined;
try {
let userJsonString = localStorage.getItem("token");
@@ -34,6 +35,7 @@ class App extends Component {
let date = new Date().getTime();
if (userJsonString && exp && date < exp) {
loggedIn = true;
+ token = userJsonString;
} else {
localStorage.removeItem("token");
localStorage.removeItem("exp");
@@ -42,6 +44,7 @@ class App extends Component {
this.state = {
loggedIn: loggedIn,
+ token: token,
};
this.auth = this.auth.bind(this);
diff --git a/smart-hut/src/components/dashboard/devices/NewDevice.js b/smart-hut/src/components/dashboard/devices/NewDevice.js
index 9026c6f..b460007 100644
--- a/smart-hut/src/components/dashboard/devices/NewDevice.js
+++ b/smart-hut/src/components/dashboard/devices/NewDevice.js
@@ -144,11 +144,17 @@ export default class NewDevice extends Component {
image: { avatar: true, src: "/img/switchOn.svg" },
},
{
- key: "dimmer",
- text: "Dimmer",
+ key: "buttonDimmer",
+ text: "Button Dimmer",
value: "buttonDimmer",
image: { avatar: true, src: "/img/dimmer.svg" },
},
+ {
+ key: "knobDimmer",
+ text: "Knob Dimmer",
+ value: "knobDimmer",
+ image: { avatar: true, src: "/img/dimmer.svg" },
+ },
];
const sensorOptions = [
{
@@ -176,13 +182,27 @@ export default class NewDevice extends Component {
image: { avatar: true, src: "/img/sensorOn.svg" },
},
];
- const availableLights = [];
+ const availableSwitchDevices = [];
+ const availableDimmerDevices = [];
this.props.devices.forEach((d) => {
- availableLights.push({
- key: d.id,
- text: d.name,
- value: d.id,
- });
+ if (
+ d.kind === "regularLight" ||
+ d.kind === "dimmableLight" ||
+ d.kind === "smartPlug"
+ ) {
+ availableSwitchDevices.push({
+ key: d.id,
+ text: d.name,
+ value: d.id,
+ });
+ }
+ if (d.kind === "dimmableLight") {
+ availableDimmerDevices.push({
+ key: d.id,
+ text: d.name,
+ value: d.id,
+ });
+ }
});
const step1 = (
- Hey what are you doing here? Looks like you are - lost, this room does not exist. Maybe you were - looking for the kitchen, or the garage, or the - bedroom, or your love room... so don't wait here and - let's go back to our main room! ...or refresh this - page some times... -
- -+ Hey what are you doing here? Looks like you are lost, + this room does not exist. Maybe you were looking for + the kitchen, or the garage, or the bedroom, or your + love room... so don't wait here and let's go back to + our main room! ...or refresh this page some times... +
+ +- Hey what are you doing here? Looks like you are - lost, this room does not exist. Maybe you were - looking for the kitchen, or the garage, or the - bedroom, or your love room... so don't wait here and - let's go back to our main room! ...or refresh this - page some times... -
- -+ Hey what are you doing here? Looks like you are lost, + this room does not exist. Maybe you were looking for + the kitchen, or the garage, or the bedroom, or your + love room... so don't wait here and let's go back to + our main room! ...or refresh this page some times... +
+ +