Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lawrencebensaid/enet-api
eNet smart home API and CLI.
https://github.com/lawrencebensaid/enet-api
api cli enet enet-api
Last synced: 16 days ago
JSON representation
eNet smart home API and CLI.
- Host: GitHub
- URL: https://github.com/lawrencebensaid/enet-api
- Owner: lawrencebensaid
- Created: 2021-03-16T16:48:39.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-01-07T19:30:31.000Z (about 2 years ago)
- Last Synced: 2024-12-15T12:17:16.388Z (25 days ago)
- Topics: api, cli, enet, enet-api
- Language: TypeScript
- Homepage:
- Size: 42 KB
- Stars: 7
- Watchers: 4
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# eNet API & CLI
API and CLI for eNet smart home.
**To install the CLI on your device**
`$ npm install -g enet-api`
**To add the API to your project as dependency**
`$ npm install enet-api`
## Implementing the API
```js
const { ENet } = require("enet-api");(async () => {
// Authenticate with eNet server
const enet = new ENet("192.168.0.7");
const token = await enet.authenticate("admin", "admin");// Power on the first device in the array.
const devices = await enet.getDevices();
await enet.setDevicePrimaryState(devices[0].deviceUID, true);})();
```
## Using the CLI
```
Usage: main [options] [command]eNet Smart Home utility CLI.
Options:
-V, --version output the version number
-d, --debug Debug
-j, --json JSON
-p, --pretty Pretty printed
-s, --include-state Include device state in device list (when executing 'enet device ls')
-h, --help display help for commandCommands:
auth authenticate with eNet
deauth Authenticate with eNet interface.
location manage locations
project [project] manage devices
device [action] [function] [value] manage devices
function manage devices
get manage variables
set manage variables
help [command] display help for command
```