예제 #1
0
        public async Task UpdateSensorTest()
        {
            IHueRequest request = new UpdateSensorRequest(2, "Schalter Schlafzimmer");

            var response = await _client.GetResponseAsync(request);

            Assert.True(response is SuccessResponse);
            OnLog(response);
        }
예제 #2
0
        public async Task <IActionResult> Put([FromBody] UpdateSensorRequest request, Guid id)
        {
            if (OrganisationId == Guid.Empty)
            {
                return(Forbid());
            }
            var sensorDto = _mapper.Map <SensorDto>(request);

            sensorDto.Id             = id;
            sensorDto.OrganisationId = OrganisationId;
            await _sensorService.UpdateAsync(sensorDto);

            return(NoContent());
        }