Exemple #1
0
        public LifxLightStatus GetLightStatus()
        {
            LifxGetLightStatusCommand command = new LifxGetLightStatusCommand();

            LifxCommunicator.Instance.SendCommand(command, this);

            LifxLightStatusMessage lsMessage = (LifxLightStatusMessage)command.ReturnMessage;

            //HSLColor hslColor = new HSLColor((double)(lsMessage.Hue * 240 / 65535), (double)(lsMessage.Saturation * 240 / 65535), (double)(lsMessage.Lumnosity * 240 / 65535));

            LifxColor color = new LifxColor(lsMessage.Hue, lsMessage.Saturation, lsMessage.Lumnosity, lsMessage.Kelvin);

            LifxLightStatus lightsStatus = new LifxLightStatus(color, lsMessage.PowerState, lsMessage.Dim, lsMessage.Label, lsMessage.Tags);

            return(lightsStatus);
        }
Exemple #2
0
        public LifxLightStatus GetLightStatus()
        {

            LifxGetLightStatusCommand command = new LifxGetLightStatusCommand();

            LifxCommunicator.Instance.SendCommand(command, this);

            LifxLightStatusMessage lsMessage = (LifxLightStatusMessage)command.ReturnMessage;

            //HSLColor hslColor = new HSLColor((double)(lsMessage.Hue * 240 / 65535), (double)(lsMessage.Saturation * 240 / 65535), (double)(lsMessage.Lumnosity * 240 / 65535));

            LifxColor color = new LifxColor(lsMessage.Hue, lsMessage.Saturation, lsMessage.Lumnosity, lsMessage.Kelvin);

            LifxLightStatus lightsStatus = new LifxLightStatus(color, lsMessage.PowerState, lsMessage.Dim, lsMessage.Label, lsMessage.Tags);

            return lightsStatus;
                
        }