/// <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); }
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); }
public async Task <LifxPowerStateMessage> SetPowerStateCommand(LifxPowerState stateToSet) { LifxSetPowerStateCommand command = new LifxSetPowerStateCommand(stateToSet); return(await LifxCommunicator.Instance.SendCommand(command, this) as LifxPowerStateMessage); }