public override Task HandleCommand(MPowerConnector connector, CancellationToken token, double value, ePairControlUse control) { bool?output = null; if (control == ePairControlUse._Off) { output = false; } else if (control == ePairControlUse._On) { output = true; } else if (value == OffValue) { output = false; } else if (value == OnValue) { output = true; } if (output.HasValue) { return(connector.UpdateOutput(Port, output.Value, token)); } else { return(Task.CompletedTask); } }
public override Task HandleCommand(MPowerConnector connector, CancellationToken token, double value, ePairControlUse control) { bool output = false; if (control == ePairControlUse._Off) { output = false; } else if (control == ePairControlUse._On) { output = true; } else if (value == OffValue) { output = false; } else if (value == OnValue) { output = true; } return(connector.UpdateOutput(Port, output, token)); }