forked from ericmagnuson/rmcontrol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreadme.txt
65 lines (47 loc) · 2.03 KB
/
readme.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
## RM Control
RM Control is an app to control an RM2 by BroadLink. It allows users to learn IR and RF codes, store them, and fire them.
### Components
1. vue.js front-end
2. python back-end
3. process watcher by supervisord
### Requirements
1. `build-essential`
2. `libavahi-compat-libdnssd-dev`
3. `nodejs` (>6.0.0)
4. `node-gyp`
5. `python` (2.7)
### Installation
1. `git clone https://github.com/ericmagnuson/rmcontrol.git && cd rmcontrol`
2. `python setup.py install`
3. `export FLASK_APP=rmcontrol; python -m flask initdb`
4. `python run.py`
RM Control can be interacted with by visiting the included web interface found at http://127.0.0.1:5000 or by talking directly with the API as described farther below.
### VM Initialization (Under construction.)
1. `curl -sL https://deb.nodesource.com/setup_6.x -o nodesource_setup.sh`
2. `sudo bash nodesource_setup.sh`
3. `sudo apt-get update`
4. `sudo apt-get install build-essential git libavahi-compat-libdnssd-dev nodejs node-gyp python-setuptools python-pip`
5. `pip install pycrypto`
6. `sudo reboot now`
7. `sudo npm install -g --unsafe-perm request homebridge homebridge-httpmulti`
8. To install RM Control, follow the steps in Installation above.
9. Using Homebridge-HttpMulti, configure Homebridge to send commands to the RM Control API. See `config.json.sample` for an example.
### Supervisor Setup
1. `sudo apt-get install supervisor`
2. In `/etc/supervisor/conf.d/`, add two configuration files, `rmcontrol.conf` and `homebridge.conf`. See sample files for help.
3. `sudo service supervisor reload`
### API Documentation
`GET /`
Shows all commands.
`POST / {name: <name>}`
Listens for a command from the RM2, and if a command is received, it will be saved with the given name.
`POST /<name>`
Fire the given command.
`PATCH /<name> {name: <name?>, code: <code?>}`
Edit the requested command by passing in a new name and/or code.
`DELETE /<name>`
Delete the given command.
### To Do
- Add progress icon when learning.
- Finish edit capability.
- Gracefully handle errors if RM2 cannot be found.