Skip to content

Commit

Permalink
Updated whiteLED channel for reolink ipcamera so that when the
Browse files Browse the repository at this point in the history
light is turned on, it will stay on forever and if the light is
turned off, it will stay off forever.

Signed-off-by: Simmon Yau <simmonyau@gmail.com>
  • Loading branch information
simmonyau committed May 2, 2024
1 parent ec5b511 commit 8ba123a
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -496,16 +496,16 @@ public void handleCommand(ChannelUID channelUID, Command command) {
if (OnOffType.OFF.equals(command) || PercentType.ZERO.equals(command)) {
ipCameraHandler.sendHttpPOST("/api.cgi?cmd=SetWhiteLed" + ipCameraHandler.reolinkAuth,
"[{\"cmd\": \"SetWhiteLed\",\"param\": {\"WhiteLed\": {\"state\": 0,\"channel\": "
+ ipCameraHandler.cameraConfig.getNvrChannel() + ",\"mode\": 1}}}]");
+ ipCameraHandler.cameraConfig.getNvrChannel() + ",\"mode\": 0}}}]");
} else if (OnOffType.ON.equals(command)) {
ipCameraHandler.sendHttpPOST("/api.cgi?cmd=SetWhiteLed" + ipCameraHandler.reolinkAuth,
"[{\"cmd\": \"SetWhiteLed\",\"param\": {\"WhiteLed\": {\"state\": 1,\"channel\": "
+ ipCameraHandler.cameraConfig.getNvrChannel() + ",\"mode\": 0}}}]");
+ ipCameraHandler.cameraConfig.getNvrChannel() + ",\"mode\": 2}}}]");
} else if (command instanceof PercentType percentCommand) {
int value = percentCommand.toBigDecimal().intValue();
ipCameraHandler.sendHttpPOST("/api.cgi?cmd=SetWhiteLed" + ipCameraHandler.reolinkAuth,
"[{\"cmd\": \"SetWhiteLed\",\"param\": {\"WhiteLed\": {\"state\": 1,\"channel\": "
+ ipCameraHandler.cameraConfig.getNvrChannel() + ",\"mode\": 1,\"bright\": " + value
+ ipCameraHandler.cameraConfig.getNvrChannel() + ",\"mode\": 2,\"bright\": " + value
+ "}}}]");
}
}
Expand Down

0 comments on commit 8ba123a

Please sign in to comment.