public void CreateGetRequestShouldReturnRequestWithCorrectProperties() { var request = RequestFactory.CreateGetRequest(); CheckRequestProperties( request, command: Command.LightGet, ackRequired: false, resRequired: true, payloadType: typeof(RequestPayload) ); }
public async Task <LightState> GetStateAsync(CancellationToken cancellationToken) { var request = _requestFactory.CreateGetRequest(); var payload = await _communicator.CommunicateAsync <StateResponsePayload>(request, cancellationToken) .ConfigureAwait(false); return(new LightState( payload.Label, payload.Power, payload.Brightness, payload.Temperature, payload.Color )); }