Exemple #1
0
        /// <summary>
        /// Set current power state
        /// </summary>
        /// <param name="stateToSet"></param>
        /// <returns>Returns the set power state</returns>
        public LifxPowerState SetPowerState(LifxPowerState stateToSet)
        {
            LifxSetPowerStateCommand command = new LifxSetPowerStateCommand(stateToSet);

            LifxCommunicator.Instance.SendCommand(command, this);

            LifxPowerStateMessage returnMessage = (LifxPowerStateMessage)command.ReturnMessage;

            return(returnMessage.PowerState);
        }
Exemple #2
0
        public async Task <LifxPowerStateMessage> SetPowerStateCommand(string stateToSet)
        {
            LifxSetPowerStateCommand command = new LifxSetPowerStateCommand((LifxPowerState)Enum.Parse(typeof(LifxPowerState), stateToSet, true));

            return(await LifxCommunicator.Instance.SendCommand(command, this) as LifxPowerStateMessage);
        }
Exemple #3
0
        public async Task <LifxPowerStateMessage> SetPowerStateCommand(LifxPowerState stateToSet)
        {
            LifxSetPowerStateCommand command = new LifxSetPowerStateCommand(stateToSet);

            return(await LifxCommunicator.Instance.SendCommand(command, this) as LifxPowerStateMessage);
        }