https://github.com/netbeast/react-native-yeelight
Yeelight controller for react native
https://github.com/netbeast/react-native-yeelight
react-native xiaomi-smart-home yeelight-wifi
Last synced: about 1 month ago
JSON representation
Yeelight controller for react native
- Host: GitHub
- URL: https://github.com/netbeast/react-native-yeelight
- Owner: netbeast
- License: mit
- Created: 2017-04-10T20:22:36.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-12-12T16:34:32.000Z (over 7 years ago)
- Last Synced: 2025-03-16T00:42:04.576Z (over 1 year ago)
- Topics: react-native, xiaomi-smart-home, yeelight-wifi
- Language: JavaScript
- Homepage: https://getyeti.co
- Size: 1.32 MB
- Stars: 3
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# yeelight-wifi
[](https://circleci.com/gh/pmdroid/yeelight-wifi)
[](https://codecov.io/gh/pmdroid/yeelight-wifi)
The [Yeelight WiFi Lib](https://github.com/pmdroid/yeelight-wifi) docs are located [here](https://pmdroid.github.io/yeelight-wifi/).
Using npm:
```shell
$ npm i --save yeelight-wifi
```
In Node.js:
```js
const YeelightSearch = require('yeelight-wifi');
const yeelightSearch = new YeelightSearch();
yeelightSearch.on('found', (lightBulb) => {
lightBulb.toggle()
.then(() => {
console.log('toggled');
})
.catch((err) => {
console.log(`received some error: ${err}`);
});
});
```