DLink-Camera-Manager icon indicating copy to clipboard operation
DLink-Camera-Manager copied to clipboard

Mappings section in the device handler

Open zavalyshyn opened this issue 5 years ago • 0 comments

Hi,

Big thanks for the code you wrote. It was the only way for me to use my D-link camera with SmartThings.

I have a question about the mappings section in the device handler code.

Specifically this one:

    mappings {
    	path("/getInHomeURL") {
    		action:
    		[GET: "getInHomeURL"]
   		}
	}
     
     def getInHomeURL() {
        [InHomeURL: "http://${state.cameraUser}:${state.cameraPassword}@${state.videoIP}:${state.videoPort}/mjpeg.cgi?channel=1.mjpeg"]
     }

What was the purpose of it? As I understand it, the code exposes the device handler as a webapp with a REST endpoint that can process incoming GET request. It responds with the url to the camera stream.

zavalyshyn avatar Jul 21 '19 11:07 zavalyshyn