A web server used to set power schedules for TCL Roku TVs.
Before you can use this application, make sure you have the following prerequisites installed:
- Node.js: See - nodejs.org for installation instructions.
- PM2: See - pm2.keymetrics.io. Not required. Used to keep the server alive in a production environment
-
Clone this repository to your local machine:
git clone https://github.com/austinginn/tcl-roku-scheduler
-
Navigate to the directory:
cd tcl-roku-scheduler
-
Install dependecies:
npm install
npm run
For long term usage use PM2.
pm2 start server.mjs
See pm2 docs for pm2 usage.
This section outlines the available API endpoints, their purposes, request methods, and required parameters.
- Method: GET
- Description: GET API VERSION.
- Request Parameters:
- none
- Response: A JSON object { version: 1.0.0 }
Example:
GET /api
- Method: GET
- Description: GET all schedule and TV data.
- Request Parameters:
- none
- Response: A JSON object containing an array of tv objects and an array of group objects { tvs: [], groups: [] }
Example:
GET /api/data
- Method: POST
- Description: Add a tv.
- Request Body:
- name, ip address, array of groups, description
- Response: A JSON object with a response message.
Example:
POST /api/tv/add
Content-Type: application/json
{
"name": "",
"ipAddress": "192.168.0.2",
"group": [""],
"description": ""
}
- Method: POST
- Description: Add a group.
- Request Body:
- name, ip address, array of groups, description
- Response: A JSON object with a response message.
Example:
POST /api/tv/add
Content-Type: application/json
{
"name": "",
"ipAddress": "192.168.0.2",
"group": [""],
"description": ""
}
- Method: PUT
- Description: Update a tv.
- Request Body:
- name, ip address, array of groups, description
- Response: A JSON object with a response message.
Example:
PUT /api/tv/update
Content-Type: application/json
{
"name": "",
"ipAddress": "192.168.0.2",
"group": [""],
"description": ""
}
- Method: DELETE
- Description: Delete a tv.
- Request Parameters:
- ip address
- Response: A JSON object with a response message.
Example:
DELETE /api/tv/update?ipAddress=192.168.0.2
If you'd like to contribute to this project, please follow these guidelines:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them.
- Push your changes to your fork.
- Create a pull request, describing your changes in detail.
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Hey! My name is Austin. I specialize in creating custom AVL Integration solutions. If you're interseted in collaborating you can reach me at austinleeginn@gmail.com.