Skip to content

Mappings section in the device handler #9

@zavalyshyn

Description

@zavalyshyn

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions