From 1d4945a6a276e7f1fc5bf425a065ac8ed0f25fb9 Mon Sep 17 00:00:00 2001 From: Jacob Salvi Date: Thu, 23 Apr 2020 15:34:23 +0200 Subject: [PATCH] small changes --- smart-hut/package-lock.json | 22 ++++++++++++++++ smart-hut/package.json | 2 +- .../src/components/dashboard/devices/Light.js | 1 - .../components/dashboard/devices/NewDevice.js | 26 +++++++++++++++++++ smart-hut/yarn.lock | 23 +++++----------- 5 files changed, 55 insertions(+), 19 deletions(-) diff --git a/smart-hut/package-lock.json b/smart-hut/package-lock.json index b2d2c82..d39ace7 100644 --- a/smart-hut/package-lock.json +++ b/smart-hut/package-lock.json @@ -10922,6 +10922,11 @@ "scheduler": "^0.18.0" } }, + "react-dom-factories": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/react-dom-factories/-/react-dom-factories-1.0.2.tgz", + "integrity": "sha1-63cFxNs2+1AbOqOP91lhaqD/luA=" + }, "react-error-overlay": { "version": "6.0.6", "resolved": "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-6.0.6.tgz", @@ -10932,6 +10937,23 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.12.0.tgz", "integrity": "sha512-rPCkf/mWBtKc97aLL9/txD8DZdemK0vkA3JMLShjlJB3Pj3s+lpf1KaBzMfQrAmhMQB0n1cU/SUGgKKBCe837Q==" }, + "react-modal": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/react-modal/-/react-modal-2.2.2.tgz", + "integrity": "sha512-tdgyEyfbyfzDUj40XtWldAQe7e+yhJDUtVSlsQ9AQCGifzWck6v1XTtIVGViVftOsEA3cBWCZCjF3rq6FPJzMg==", + "requires": { + "exenv": "1.2.0", + "prop-types": "^15.5.10", + "react-dom-factories": "^1.0.0" + }, + "dependencies": { + "exenv": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/exenv/-/exenv-1.2.0.tgz", + "integrity": "sha1-ODXxJ6vwdb/ggtCu1EhAV8eOPIk=" + } + } + }, "react-popper": { "version": "1.3.7", "resolved": "https://registry.npmjs.org/react-popper/-/react-popper-1.3.7.tgz", diff --git a/smart-hut/package.json b/smart-hut/package.json index 74f3aa1..502c36b 100644 --- a/smart-hut/package.json +++ b/smart-hut/package.json @@ -19,7 +19,7 @@ "react-circular-slider-svg": "^0.1.5", "react-device-detect": "^1.11.14", "react-dom": "^16.12.0", - "react-modal": "2.2.2", + "react-modal": "^2.2.2", "react-redux": "^7.2.0", "react-round-slider": "^1.0.1", "react-router": "^5.1.2", diff --git a/smart-hut/src/components/dashboard/devices/Light.js b/smart-hut/src/components/dashboard/devices/Light.js index 5d01d89..3a66170 100644 --- a/smart-hut/src/components/dashboard/devices/Light.js +++ b/smart-hut/src/components/dashboard/devices/Light.js @@ -7,7 +7,6 @@ * Lights have an internal state that can be changed and it must * be shown accordingly in the SmartHut views (house view and room views). */ - import React, { Component } from "react"; import { iconStyle, diff --git a/smart-hut/src/components/dashboard/devices/NewDevice.js b/smart-hut/src/components/dashboard/devices/NewDevice.js index ff0ef72..d5fa59c 100644 --- a/smart-hut/src/components/dashboard/devices/NewDevice.js +++ b/smart-hut/src/components/dashboard/devices/NewDevice.js @@ -112,8 +112,20 @@ class NewDevice extends Component { if (this.state.deviceName === "") { data.name = defaultNames[this.state.typeOfDevice]; } + console.log("-------------------------"); + console.log(this.state.typeOfDevice); switch (this.state.typeOfDevice) { + //trying to make securityCamera work + case "securityCamera": + // data.path="/security_camera_videos/security_camera_1.mp4"; + // data.on=false; + break; + //trying to make thermostat work + case "thermostat": + data.targetTemperature=0; + data.measuredTemperuature=0; + break; case "dimmableLight": data.intensity = 0; break; @@ -145,6 +157,20 @@ class NewDevice extends Component { render() { const deviceOptions = [ + //stuff + {key:"securityCamera", + text:"SecurityCamera", + value:"securityCamera", + image:{}}, + {key:"thermostat", + text:"Thermostat", + value:"thermostat", + image:{}}, + {key:"curtains", + text:"Curtain", + value:"curtains", + image:{}}, + //stuff ends { key: "light", text: "Normal Light", diff --git a/smart-hut/yarn.lock b/smart-hut/yarn.lock index 17e0c1b..4364834 100644 --- a/smart-hut/yarn.lock +++ b/smart-hut/yarn.lock @@ -4243,12 +4243,7 @@ execa@^1.0.0: signal-exit "^3.0.0" strip-eof "^1.0.0" -exenv@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/exenv/-/exenv-1.2.0.tgz#3835f127abf075bfe082d0aed4484057c78e3c89" - integrity sha1-ODXxJ6vwdb/ggtCu1EhAV8eOPIk= - -exenv@^1.2.2: +exenv@^1.2.0, exenv@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/exenv/-/exenv-1.2.2.tgz#2ae78e85d9894158670b03d47bec1f03bd91bb9d" integrity sha1-KueOhdmJQVhnCwPUe+wfA72Ru50= @@ -8741,11 +8736,6 @@ react-device-detect@^1.11.14: dependencies: ua-parser-js "^0.7.20" -react-dom-factories@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/react-dom-factories/-/react-dom-factories-1.0.2.tgz#eb7705c4db36fb501b3aa38ff759616aa0ff96e0" - integrity sha1-63cFxNs2+1AbOqOP91lhaqD/luA= - react-dom@^16.12.0: version "16.12.0" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.12.0.tgz#0da4b714b8d13c2038c9396b54a92baea633fe11" @@ -8776,14 +8766,13 @@ react-is@^16.9.0: resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== -react-modal@2.2.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/react-modal/-/react-modal-2.2.2.tgz#4bbf98bc506e61c446c9f57329c7a488ea7d504b" - integrity sha512-tdgyEyfbyfzDUj40XtWldAQe7e+yhJDUtVSlsQ9AQCGifzWck6v1XTtIVGViVftOsEA3cBWCZCjF3rq6FPJzMg== +react-modal@^2.2.2: + version "2.4.1" + resolved "https://registry.yarnpkg.com/react-modal/-/react-modal-2.4.1.tgz#cb09b26711b148eb9f59cb180e1b7d82980ded05" + integrity sha512-3WQCn3xqkbEUvxRUO3nkeqxMNgt1F4CyEU3BiUIrg7C71tnqjQIuSE7+JXp85yFl8X1iRTJouySNpwNqv4kiWg== dependencies: - exenv "1.2.0" + exenv "^1.2.0" prop-types "^15.5.10" - react-dom-factories "^1.0.0" react-popper@^1.3.4: version "1.3.7"