-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
configure travis, add readme.md and license file
- Loading branch information
Showing
5 changed files
with
128 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
language: node_js | ||
node_js: | ||
- "10" | ||
after_success: | ||
- npm run coveralls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2019 Christian Kühl | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
[![npm version](https://img.shields.io/npm/v/sphero-connector-core.svg?style=flat)](https://www.npmjs.org/package/sphero-connector-core) | ||
[![Dependency Status](https://david-dm.org/chrkhl/sphero-connector-core.svg)](https://david-dm.org/chrkhl/sphero-connector-core) | ||
[![devDependency Status](https://david-dm.org/chrkhl/sphero-connector-core/dev-status.svg)](https://david-dm.org/chrkhl/sphero-connector-core#info=devDependencies) | ||
[![Build Status](https://travis-ci.org/chrkhl/sphero-connector-core.svg?branch=master)](https://travis-ci.org/chrkhl/sphero-connector-core) | ||
[![Coverage](https://coveralls.io/repos/github/chrkhl/sphero-connector-core/badge.svg?branch=master)](https://coveralls.io/github/chrkhl/sphero-connector-core?branch=master) | ||
|
||
<img src="./assets/sphero-connector-core.svg" alt="Sphero Connector Core" width="280" /> | ||
|
||
|
||
# Sphero Connector Core | ||
|
||
This is a thin (and partial) wrapper around the [unofficial Sphero V2 API](https://github.com/igbopie/spherov2.js) for Sphero toys use by [Sphero Connector HTTP](https://github.com/chrkhl/sphero-connector-http.js) and [Sphero Connector IPC](https://github.com/chrkhl/sphero-connector-ipc.js). | ||
|
||
|
||
## API | ||
|
||
### Connect Toy | ||
|
||
The following methods try to find a toy and establish a connection with it. | ||
|
||
* `async connectSpheroMini()` | ||
* `async connectSpheroMiniWithName(toyName: string)` | ||
* `async connectLightningMcQueen()` | ||
* `async connectR2D2()` | ||
* `async connectR2Q5()` | ||
* `async connectBB9E()` | ||
* `async connectToy(toyType: string, toyName: string)` | ||
|
||
Valid values for `toyType` are: `SpheroMini`, `LightningMcQueen`, `R2D2`, `R2Q5`, `BB9E`. | ||
|
||
If a toy is found and connected, each of these methods will return an object with the following structure: | ||
|
||
``` javascript | ||
{ | ||
wake: function() { ... }, | ||
sleep: function() { ... }, | ||
setMainLedColor: function(hexColor: string) { ... } | ||
} | ||
``` | ||
|
||
## Example: Connect Sphero Mini and set main LED color red | ||
|
||
``` javascript | ||
const connector = require('sphero-connector-core'); | ||
|
||
const spheroMini = await connector.connectSpheroMini(); | ||
|
||
spheroMini.setMainLedColor('#FF0000'); | ||
|
||
``` | ||
|
||
|
||
## License | ||
|
||
Please be aware of the licenses of the components used in this project. | ||
Everything else that has been developed by the contributions to this project is under [MIT License](LICENSE). |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters