diff --git a/smart-hut/src/components/dashboard/devices/Curtain.js b/smart-hut/src/components/dashboard/devices/Curtain.js index 25873d2..54e98df 100644 --- a/smart-hut/src/components/dashboard/devices/Curtain.js +++ b/smart-hut/src/components/dashboard/devices/Curtain.js @@ -64,21 +64,7 @@ class Curtain extends Component { } }; - helper2 = () => { - if (this.props.device.intensity <= 10) { - this.setIntensity(0); - this.saveIntensity(); - } else { - this.setIntensity(this.props.device.intensity / 100 - 0.1); - this.saveIntensity(); - } - }; - helper3 = (a) => { - //console.log(a); - this.setIntensity(a / 100); - this.saveIntensity(); - }; ///*this took me way too much more time than it should have*/ handleChange = (a) => { @@ -107,22 +93,7 @@ class Curtain extends Component { max="100" /> - /* -
-

{this.props.device.intensity}

- { - this.helper3(val); - }} - /> - - - -
*/ ); } } diff --git a/smart-hut/src/components/dashboard/devices/Curtains.js b/smart-hut/src/components/dashboard/devices/Curtains.js deleted file mode 100644 index 8a259a9..0000000 --- a/smart-hut/src/components/dashboard/devices/Curtains.js +++ /dev/null @@ -1,41 +0,0 @@ -// TODO Remove this! - -import React, { Component } from "react"; -import "./Curtains.css"; - -class Curtain extends Component { - constructor(props) { - super(props); - this.state = { - open: 0.6, - }; - } - - handleChange = (e) => { - this.setState({ open: e.target.value / 100 }); - }; - - render() { - return ( -
-
{" "} - - {Math.round(this.state.open * 100)}% - - -
- ); - } -} - -export default Curtain; diff --git a/smart-hut/src/components/dashboard/devices/Thermostat.js b/smart-hut/src/components/dashboard/devices/Thermostat.js deleted file mode 100644 index e14f9e0..0000000 --- a/smart-hut/src/components/dashboard/devices/Thermostat.js +++ /dev/null @@ -1,62 +0,0 @@ -// TODO Remove this! - -import React, { Component } from "react"; -import { - stateTag, - container, - deviceName, - targetTemperature, - slider, - line, - stateTagContainer, -} from "./ThermostatStyle"; - -class Thermostat extends Component { - constructor(props) { - super(props); - this.state = { - currentTemperature: 10, - targetTemperature: 20, - state: "idle", - }; - } - - handleChange = (value) => { - let state = this.state.state; - if (this.state.currentTemperature > value) { - state = "cooling"; - } else if (this.state.currentTemperature < value) { - state = "heating"; - } else { - state = "idle"; // or heating, i don't know the difference - } - - this.setState({ targetTemperature: value, state: state }); - }; - - render() { - return ( -
-

{this.props.device.name}

-
- - {this.state.targetTemperature}ÂșC - - this.handleChange(event.target.value)} - id="targetTemperature" - /> -
- {this.state.state} -
-
- ); - } -} - -export default Thermostat; diff --git a/smart-hut/src/components/dashboard/devices/Thermostats.js b/smart-hut/src/components/dashboard/devices/Thermostats.js index a3870a9..1fd69cb 100644 --- a/smart-hut/src/components/dashboard/devices/Thermostats.js +++ b/smart-hut/src/components/dashboard/devices/Thermostats.js @@ -135,32 +135,6 @@ class Thermostats extends Component { render() { return ( - /*
-

"mode is: "{this.props.device.mode}

-

- "internalsensortemperature is: " - {this.props.device.internalSensorTemperature} -

-

- "targetTemperature is: " - {this.props.device.targetTemperature} -

-

- "measuredtemperature is: " - {this.props.device.measuredTemperature} -

-

{this.props.device.on}

- - -
*/

{this.props.device.name}