Skip to content

Commit

Permalink
Initial implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Krill committed Oct 22, 2018
0 parents commit 5aec7e1
Show file tree
Hide file tree
Showing 49 changed files with 17,514 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#root = true

[*]
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 100
indent_size = 2

[*.md]
trim_trailing_whitespace = false
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
node_modules
coverage
.nyc_output
.DS_Store
*.log
.vscode
.idea
dist
compiled
.awcache
.rpt2_cache
docs
19 changes: 19 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
language: node_js
branches:
only:
- master
- /^greenkeeper/.*$/
cache:
yarn: true
directories:
- node_modules
notifications:
email: false
node_js:
- node
script:
- npm run test:prod && npm run build
after_success:
- npm run report-coverage
- npm run deploy-docs
- npm run semantic-release
7 changes: 7 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright 2017 Joe Krill <joe@joekrill.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# elk-connect

A module for connecting to an [Elk M1](https://www.elkproducts.com/product-catalog/m1-gold-cross-platform-control) security system over a TCP connection.


### Usage

Install with NPM or Yarn

```
npm install elk-client
// or
yarn add elk-client
```

```
import { ElkClient } from 'elk-client';
// Parse a message
const client = new ElkClient('elkm1s://someuser:supersecretpassword@192.168.0.251?timeout=30');
client
.connect()
.then(() => client.getArmingStatus())
.then((armingStatus) => {
const area1 = armingStatus.getAreaStatus(1);
console.log('Area 1 status:', ArmingLevel[area1.armingLevel])
})
.then(() => client.disconnect())
.then(() => {
console.log('Done!');
})
.catch((err) => {
console.error(err);
});
```
Loading

0 comments on commit 5aec7e1

Please sign in to comment.