Skip to content
This repository was archived by the owner on Apr 8, 2022. It is now read-only.

Open-Controller/lib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

codecov GitHub Workflow Status Github Releases Downloads GitHub package.json version

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

// license

GPL-3.0

About

A library used to represent Open Controller homes for Open Controller clients

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors 3

  •  
  •  
  •