[ipcamera] Fix multiple WARNs when HIK camera does not support alarm inputs (#13606)
* Fix never ending WARN when HIK camera does not support alarm inputs. * Streamline code. Signed-off-by: Matthew Skinner <matt@pcmus.com>
This commit is contained in:
parent
a68ff57c17
commit
234d354a2e
|
@ -15,7 +15,6 @@ package org.openhab.binding.ipcamera.internal;
|
||||||
import static org.openhab.binding.ipcamera.internal.IpCameraBindingConstants.*;
|
import static org.openhab.binding.ipcamera.internal.IpCameraBindingConstants.*;
|
||||||
|
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||||
import org.eclipse.jdt.annotation.Nullable;
|
import org.eclipse.jdt.annotation.Nullable;
|
||||||
|
@ -423,12 +422,4 @@ public class HikvisionHandler extends ChannelDuplexHandler {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If a camera does not need to poll a request as often as snapshots, it can be
|
|
||||||
// added here. Binding steps through the list.
|
|
||||||
public ArrayList<String> getLowPriorityRequests() {
|
|
||||||
ArrayList<String> lowPriorityRequests = new ArrayList<String>(1);
|
|
||||||
lowPriorityRequests.add("/ISAPI/System/IO/inputs/" + nvrChannel + "/status"); // must stay in element 0.
|
|
||||||
return lowPriorityRequests;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1270,9 +1270,6 @@ public class IpCameraHandler extends BaseThingHandler {
|
||||||
case HIKVISION_THING:
|
case HIKVISION_THING:
|
||||||
HikvisionHandler hikvisionHandler = new HikvisionHandler(getHandle(), cameraConfig.getNvrChannel());
|
HikvisionHandler hikvisionHandler = new HikvisionHandler(getHandle(), cameraConfig.getNvrChannel());
|
||||||
hikvisionHandler.handleCommand(channelUID, command);
|
hikvisionHandler.handleCommand(channelUID, command);
|
||||||
if (lowPriorityRequests.isEmpty()) {
|
|
||||||
lowPriorityRequests = hikvisionHandler.getLowPriorityRequests();
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case FOSCAM_THING:
|
case FOSCAM_THING:
|
||||||
FoscamHandler foscamHandler = new FoscamHandler(getHandle(), cameraConfig.getUser(),
|
FoscamHandler foscamHandler = new FoscamHandler(getHandle(), cameraConfig.getUser(),
|
||||||
|
@ -1631,6 +1628,9 @@ public class IpCameraHandler extends BaseThingHandler {
|
||||||
if (snapshotUri.isEmpty()) {
|
if (snapshotUri.isEmpty()) {
|
||||||
snapshotUri = "/ISAPI/Streaming/channels/" + cameraConfig.getNvrChannel() + "01/picture";
|
snapshotUri = "/ISAPI/Streaming/channels/" + cameraConfig.getNvrChannel() + "01/picture";
|
||||||
}
|
}
|
||||||
|
if (lowPriorityRequests.isEmpty()) {
|
||||||
|
lowPriorityRequests.add("/ISAPI/System/IO/inputs/" + cameraConfig.getNvrChannel() + "/status");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case INSTAR_THING:
|
case INSTAR_THING:
|
||||||
if (snapshotUri.isEmpty()) {
|
if (snapshotUri.isEmpty()) {
|
||||||
|
|
Loading…
Reference in New Issue