@open-controller/lib
v0.27.0
Published
Library for remotes.
Downloads
308
Readme
Open Controller Lib
A library used to represent Open Controller homes for Open Controller clients. It is designed to retain all information in JSON form, for portability.
// structure
_______________________
| Device |
House->Room[]->Controller[]->Widget[]->| Action|DynamicValue |
| |
-----------------------
// usage
const device = new Device({
name:"testDevice",
actions:[
new HttpAction({
name:"on",
method:"GET",
base:"http://device.ip/",
path:"turnOn"
})
]
})
const controller = new Controller({
name:"Test Controller",
layout:[
<Button action={device.getAction("on")} icon="power-on"/>
//OR
//new Button({
// action:device.getAction("on"),
// icon:"power-on"
//})
]
})
const room = new Room({name:"Test Room",controllers:[controller]})
new House({name:"Test House",rooms:[room]})
// building
yarn
yarn build
// contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests and docs as appropriate.
Commit messages should follow the Conventional Commit Spec