diff --git a/smart-hut/public/paranormal-activity.mp4 b/smart-hut/public/paranormal-activity.mp4 new file mode 100644 index 0000000..f3bc61a Binary files /dev/null and b/smart-hut/public/paranormal-activity.mp4 differ diff --git a/smart-hut/src/components/dashboard/devices/Light.js b/smart-hut/src/components/dashboard/devices/Light.js index 9143ec3..d4debca 100644 --- a/smart-hut/src/components/dashboard/devices/Light.js +++ b/smart-hut/src/components/dashboard/devices/Light.js @@ -10,26 +10,9 @@ import React, { Component } from "react"; import { - iconStyle, - StyledDiv, - BottomPanel, - ThumbText, -} from "./styleComponents"; -import { Image } from "semantic-ui-react"; -import { - CircularInput, - CircularProgress, - CircularThumb, -} from "react-circular-input"; -import { - LightDimmerContainer, - LightDimmerStyle, - textStyle, - nameStyle, - KnobProgress, - CircularThumbStyle, - knobIcon, -} from "./LightStyle"; + StyledDiv,hAbRNe +} from "./VideocmStyle"; +import { Checkbox, Embed, Button, Grid, Responsive, Segment } from "semantic-ui-react"; import { RemoteService } from "../../../remote"; import { connect } from "react-redux"; @@ -40,18 +23,13 @@ class Light extends Component { this.iconOn = "/img/lightOn.svg"; this.iconOff = "/img/lightOff.svg"; - - this.setIntensity = this.setIntensity.bind(this); } get turnedOn() { return this.props.device.on; } - get intensity() { - return this.props.device.intensity || 0; - } - + onClickDevice = () => { const on = !this.turnedOn; this.props @@ -63,79 +41,48 @@ class Light extends Component { return this.turnedOn ? this.iconOn : this.iconOff; }; - setIntensity(intensity) { - intensity *= 100; - - if (this.state.timeout) { - clearTimeout(this.state.timeout); - } - - this.setState({ - intensity, - timeout: setTimeout(() => { - this.saveIntensity(); - this.setState({ - intensity: this.state.intensity, - timeout: null, - }); - }, 100), - }); - } - - saveIntensity = () => { - const intensity = Math.round(this.state.intensity); - this.props - .saveDevice({ ...this.props.device, intensity }) - .catch((err) => console.error("intensity light update error", err)); - }; render() { - const intensityLightView = ( -
- - - Intensity light - - - - - - -
- ); const normalLightView = ( - -
- - -
Light
-
-
-
+
+ +
+ +
+
+ + + + + + + + + + + + + + + + + +
); return (
{this.props.device.kind === "dimmableLight" - ? intensityLightView + ? console.log('err') : normalLightView}
);