예제 #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);
        }
예제 #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);
        }
예제 #3
0
        public async Task <LifxPowerStateMessage> SetPowerStateCommand(LifxPowerState stateToSet)
        {
            LifxSetPowerStateCommand command = new LifxSetPowerStateCommand(stateToSet);

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