示例#1
0
        internal void HandleReceiveData(Object sender, LightDataReceivedEventArgs Data)
        {
            ushort red   = 0;
            ushort green = 0;
            ushort blue  = 0;

            if (Data.XY != null)
            {
                if (float.Parse(Data.XY[0]) > 0)
                {
                    ColourConverter.Point     point = new ColourConverter.Point(double.Parse(Data.XY[0]), double.Parse(Data.XY[1]));
                    ColourConverter.RGBColour RGB   = ColourConverter.XYtoRGB(point, Data.Model);
                    red   = Convert.ToUInt16(RGB.red * 255);
                    green = Convert.ToUInt16(RGB.green * 255);
                    blue  = Convert.ToUInt16(RGB.blue * 255);
                }
            }

            newLightInfo(Data.Name, Data.Type, Data.On.ToString(), Data.Bri, Data.Hue, Data.Sat, red, green,
                         blue, Data.Reachable.ToString());
            ID    = Data.ID;
            model = Data.Model;
        }
示例#2
0
 internal void FireOnLightDataChange(LightDataReceivedEventArgs e)
 {
     _OnLightDataReceived(null, e);
 }