コード例 #1
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);
 }
コード例 #2
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);
 }
コード例 #3
0
ファイル: HueDimmer.cs プロジェクト: IoTUDresden/HoloFlows
    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());
    }
コード例 #4
0
ファイル: HueDimmer.cs プロジェクト: IoTUDresden/HoloFlows
    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());
    }
コード例 #5
0
ファイル: HueDimmer.cs プロジェクト: IoTUDresden/HoloFlows
 public IEnumerator sendState(string state)
 {
     stateRequest = RESTRequestFactory.createPOSTRequest(Settings.RestBaseURL + id, state);
     return(stateRequest.performAction());
 }
コード例 #6
0
ファイル: HueDimmer.cs プロジェクト: IoTUDresden/HoloFlows
 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());
 }