/**
Users can add dimmers, a particular kind of switch that can also modify the intensity level of a given light.
There are two types of dimmers:
• A dimmer with state stores a given intensity level and sets the light to that level. <-- StatefulDimmer
• A dimmer without state can just increase or decrease the intensity of a light. <-- DefualtDimmer
The user can change the state of a dimmer through an intuitive UI in SmartHut .
**/
import React, { Component } from "react";
import {
CircularInput,
CircularProgress,
CircularThumb,
} from "react-circular-input";
import {
ButtonDimmerContainer,
MinusPanel,
PlusPanel,
ThumbText,
} from "./styleComponents";
import {
CircularThumbStyle,
KnobDimmerStyle,
KnobProgress,
textStyle,
knobIcon,
knobContainer,
} from "./DimmerStyle";
import { RemoteService } from "../../../remote";
import { connect } from "react-redux";
export class ButtonDimmerComponent extends Component {
increaseIntensity = () => {
this.props.device.buttonDimmerDim(this.props.id, "UP")
.catch((err) => console.error('button dimmer increase error', err));
};
decreaseIntensity = () => {
this.props.device.buttonDimmerDim(this.props.id, "DOWN")
.catch((err) => console.error('button dimmer decrease error', err));
};
render() {
return (