Skip to content

Commit

Permalink
Updated whiteLED channel for reolink ipcamera so that when the (openh…
Browse files Browse the repository at this point in the history
…ab#16663)

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 <[email protected]>
  • Loading branch information
simmonyau authored May 11, 2024
1 parent 85a45ce commit f5fe9d1
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
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 f5fe9d1

Please sign in to comment.