Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mappings section in the device handler #9

Open
zavalyshyn opened this issue Jul 21, 2019 · 0 comments
Open

Mappings section in the device handler #9

zavalyshyn opened this issue Jul 21, 2019 · 0 comments

Comments

@zavalyshyn
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant