Devices are a semantic and the recommended way of organizing Actions and DynamicValues.
They represent an external device and hold all of the actions and values associated with it.
example
const device = new Device({
name:"test",
actions:[
new HttpAction({
name:"on",
method:"GET",
base:"http://device.ip/",
path:"turnOn"
})
]
})
device.run("on") //runs the HttpAction
device.getAction("on") //returns HttpAction {name:"on", method:"GET",base:"http://device.ip/",path:"turnOn",url:"http://device.ip/turnOn"}
Devices are a semantic and the recommended way of organizing Actions and DynamicValues. They represent an external device and hold all of the actions and values associated with it.
example
const device = new Device({ name:"test", actions:[ new HttpAction({ name:"on", method:"GET", base:"http://device.ip/", path:"turnOn" }) ] }) device.run("on") //runs the HttpAction device.getAction("on") //returns HttpAction {name:"on", method:"GET",base:"http://device.ip/",path:"turnOn",url:"http://device.ip/turnOn"}