Extended Devices with buttons and status

This commit is contained in:
2020-11-18 14:04:57 +01:00
parent 181985859e
commit f84ea8f0c5
7 changed files with 119 additions and 23 deletions

View File

@@ -75,6 +75,7 @@ namespace Birdmap.API.Controllers
{
_logger.LogInformation($"Getting device [{deviceID}]...");
await _hubContext.Clients.All.NotifyDeviceUpdatedAsync(deviceID);
return await _service.GetdeviceAsync(deviceID);
}
@@ -117,6 +118,7 @@ namespace Birdmap.API.Controllers
{
_logger.LogInformation($"Getting sensor [{sensorID}] of device [{deviceID}]...");
await _hubContext.Clients.All.NotifyDeviceUpdatedAsync(deviceID);
return await _service.GetsensorAsync(deviceID, sensorID);
}
@@ -131,6 +133,7 @@ namespace Birdmap.API.Controllers
_logger.LogInformation($"Turning off sensor [{sensorID}] of device [{deviceID}]...");
await _service.OfflinesensorAsync(deviceID, sensorID);
await _hubContext.Clients.All.NotifyDeviceUpdatedAsync(deviceID);
return Ok();
}
@@ -146,6 +149,7 @@ namespace Birdmap.API.Controllers
_logger.LogInformation($"Turning on sensor [{sensorID}] of device [{deviceID}]...");
await _service.OnlinesensorAsync(deviceID, sensorID);
await _hubContext.Clients.All.NotifyDeviceUpdatedAsync(deviceID);
return Ok();
}