// Use this for initialization
 public CoffeeMachineActuator(string id, string state, string shortName) : base(id, state, shortName, "Icons/Coffeemaker", "Brew", null)
 {
     this.id        = id;
     this.state     = state;
     this.shortName = shortName;
     request        = RESTRequestFactory.createGETRequest(Settings.URL_CoffeeMachine_GET_Brew);
 }
示例#2
0
 public DimmerActuator(string id, string state, string shortName) : base(id, state, shortName, "Icons/Dimmer")
 {
     this.INCREASErequest = RESTRequestFactory.createPOSTRequest(Settings.RestBaseURL + id, Settings.POST_INCREASE);
     this.DECREASErequest = RESTRequestFactory.createPOSTRequest(Settings.RestBaseURL + id, Settings.POST_DECREASE);
     this.ONrequest       = RESTRequestFactory.createPOSTRequest(Settings.RestBaseURL + id, Settings.POST_ON);
     this.OFFrequest      = RESTRequestFactory.createPOSTRequest(Settings.RestBaseURL + id, Settings.POST_OFF);
 }
示例#3
0
 // Use this for initialization
 void Start()
 {
     request             = RESTRequestFactory.createAllItemsGETRequest(Settings.RestBaseURL);
     myoRequest          = RESTRequestFactory.createMyoGETRequest(Settings.URL_MyoArmband_Status);
     coffeeRequest       = RESTRequestFactory.createCoffeemachineGETRequest(Settings.URL_CoffeeMachine_Status);
     updateCounter       = 0;
     updateCounterCoffee = 0;
 }
 // Use this for initialization
 public NormalItemActuator(string id, string state, string shortName, string icon, string On = "On", string Off = "Off") : base(id, state, shortName, icon)
 {
     this.id         = id;
     this.state      = state;
     this.shortName  = shortName;
     this.ONrequest  = RESTRequestFactory.createPOSTRequest(Settings.RestBaseURL + id, Settings.POST_ON);
     this.OFFrequest = RESTRequestFactory.createPOSTRequest(Settings.RestBaseURL + id, Settings.POST_OFF);
 }
示例#5
0
    public IEnumerator sendColor(int h, int s, int v)
    {
        string color = h + "," + s + "," + v;

        this.Colorrequest = RESTRequestFactory.createPOSTRequest(Settings.RestBaseURL + hueColor.id, color);

        return(Colorrequest.performAction());
    }
示例#6
0
    public IEnumerator sendDECREASE()
    {
        int value;
        int currentValue;

        int.TryParse(state, out currentValue);

        if (currentValue < 10)
        {
            value = 0;
        }
        else
        {
            value = currentValue - 10;
        }

        this.DECREASErequest = RESTRequestFactory.createPOSTRequest(Settings.RestBaseURL + id, value.ToString());
        return(DECREASErequest.performAction());
    }
示例#7
0
 public IEnumerator sendState(string state)
 {
     stateRequest = RESTRequestFactory.createPOSTRequest(Settings.RestBaseURL + id, state);
     return(stateRequest.performAction());
 }
示例#8
0
 public HueDimmer(string id, string state, string shortName) : base(id, state, shortName, "Icons/Lamp")
 {
     this.ONrequest  = RESTRequestFactory.createPOSTRequest(Settings.RestBaseURL + id, 100.ToString());
     this.OFFrequest = RESTRequestFactory.createPOSTRequest(Settings.RestBaseURL + id, 0.ToString());
 }