Merge remote-tracking branch 'origin/webcam-usage-sensor' into webcam-usage-sensor

pull/9/head^2
sleevezipper 4 years ago
commit 311be02e18

@ -112,7 +112,7 @@ namespace UserInterface.Views
item.UpdateInterval = 5; item.UpdateInterval = 5;
break; break;
case AvailableSensors.WebcamActiveSensor: case AvailableSensors.WebcamActiveSensor:
item.Description = "This sensor shows if the webcam is currently in use."; item.Description = "This sensor shows if the webcam is currently being used.";
item.MoreInfoLink = "https://github.com/sleevezipper/hass-workstation-service#webcamactive"; item.MoreInfoLink = "https://github.com/sleevezipper/hass-workstation-service#webcamactive";
item.ShowDetectionModeOptions = true; item.ShowDetectionModeOptions = true;
item.ShowQueryInput = false; item.ShowQueryInput = false;

@ -49,6 +49,8 @@ namespace hass_workstation_service.Domain.Sensors
{ {
VideoCapture capture = new VideoCapture(0); VideoCapture capture = new VideoCapture(0);
OutputArray image = OutputArray.Create(new Mat()); OutputArray image = OutputArray.Create(new Mat());
// capture.Read() return false if it doesn't succeed in capturing
if (capture.Read(image)) if (capture.Read(image))
{ {
capture.Release(); capture.Release();

Loading…
Cancel
Save