Esempio n. 1
0
        public Boolean SetHue(string id, int v)
        {
            Aurora a = AuroraWrapper.GetAurorabySerial(id);

            if (v < a.NLJ.State.Hue.Min || v > a.NLJ.State.Hue.Max)
            {
                return(false);
            }
            a.Hue = v;
            return(true);
        }
Esempio n. 2
0
        public int SetColorTemperature(string id, int v)
        {
            Aurora a = AuroraWrapper.GetAurorabySerial(id);

            if (v > a.NLJ.State.ColorTemperature.Max || v < a.NLJ.State.ColorTemperature.Min)
            {
                return(0);
            }
            if (a.NLJ.State.ColorTemperature.Value != v)
            {
                a.ColorTemperature = v;
            }
            return(a.ColorTemperature);
        }
Esempio n. 3
0
        public int SetSaturation(string id, int v)
        {
            Aurora a = AuroraWrapper.GetAurorabySerial(id);

            if (v > a.NLJ.State.Saturation.Max || v < a.NLJ.State.Saturation.Min)
            {
                return(0);
            }
            if (a.NLJ.State.Saturation.Value != v)
            {
                a.Saturation = v;
            }
            return(a.Saturation);
        }
Esempio n. 4
0
        public int SetBrightness(string id, int v)
        {
            Aurora a = AuroraWrapper.GetAurorabySerial(id);

            if (v > a.NLJ.State.Brightness.Max || v < a.NLJ.State.Brightness.Min)
            {
                return(0);
            }
            if (a.NLJ.State.Brightness.Value != v)
            {
                a.Brightness = v;
            }
            return(a.Brightness);
        }
Esempio n. 5
0
 public string SetSelectedScenario(string id, string v)
 {
     try
     {
         Aurora a = AuroraWrapper.GetAurorabySerial(id);
         if (a.Scenarios.Contains(v) && a.SelectedScenario != v)
         {
             a.SelectedScenario = v;
         }
         return(a.SelectedScenario);
     }
     catch (Exception ex)
     {
         return(ex.Message);
     }
 }
Esempio n. 6
0
        public Boolean RenameScenario(string id, string v)
        {
            Aurora a = AuroraWrapper.GetAurorabySerial(id);

            if (a == null || !v.Contains("@"))
            {
                return(false);
            }
            var sp = v.Split('@');

            if (string.IsNullOrEmpty(sp[0]) || string.IsNullOrEmpty(sp[1]))
            {
                return(false);
            }
            return(a.RenameScenario(sp[0], sp[1]));
        }
Esempio n. 7
0
        public Boolean SetPowerState(string id, string v)
        {
            Boolean po;
            Aurora  a = AuroraWrapper.GetAurorabySerial(id);

            Boolean.TryParse(v, out po);
            if (a == null)
            {
                return(false);
            }
            if (string.IsNullOrEmpty(v))
            {
                return(a.PowerOn);
            }
            if (a.PowerOn != po)
            {
                a.PowerOn = po;
            }
            return(a.PowerOn);
        }
Esempio n. 8
0
        public String SetRandomScenario(string serial)
        {
            Aurora a = AuroraWrapper.GetAurorabySerial(serial);

            return(a.SetRandomScenario());
        }