samuraitruong / yeelight Goto Github PK
View Code? Open in Web Editor NEWThe nodeJS client library for controlling yeelight over LAN
Home Page: https://samuraitruong.github.io/yeelight/
License: MIT License
The nodeJS client library for controlling yeelight over LAN
Home Page: https://samuraitruong.github.io/yeelight/
License: MIT License
First of all, thanks for this package, it's really working great.
I've got two questions :
Is there any way to detect event happening but from the original application ?
I tried to add the logger parameter to the discover method but I can't seem to log any event
const y = require("yeelight-awesome");
const discover = new y.Discover({
port: 1982,
debug: true
}, y.logger);
Am I using it the wrong way ?
Thanks in advance
I'm getting fatal errors because of unhandled failures in promises.
Hi!
I'm using your lib to develop a desktop app.
It works pretty well with electron, but I have an issue when adding an indicator (tray icon) and can't figure out why when I call the same function as on the renderer process, I get a "connexion timeout" instead of the light reacting to it.
Here is my code, the indicator (tray icon) is in the feat/indicator
branch.
Maybe you could help me to find where the problem is ?
Thank you !
Hello!
I saw a fix on setMusic
method that isn't made available to download on npm.
This package on NPM is in version 1.0.12 and on this repository is on 1.0.15. Can you update on NPM?
Thanks!
Hi, first of all good job.
I wonder: I cannot set white color to my Yeelight Bulb.
I'm trying:
yeelight.setRGB( new Color(255,255,255) ).then( () => {
...
});
but I see a violet color.
What am I doing wrong?
Thanks in advance
Error: write ECONNABORTED
at afterWriteDispatched (internal/stream_base_commons.js:156:25)
at writeGeneric (internal/stream_base_commons.js:147:3)
at Socket._writeGeneric (net.js:798:11)
at Socket._write (net.js:810:8)
at writeOrBuffer (internal/streams/writable.js:358:12)
at Socket.Writable.write (internal/streams/writable.js:303:10)
at E:\private\autoLight\node_modules\yeelight-awesome\lib\yeelight.js:493:26
at new Promise ()
at Yeelight.sendCommand (E:\private\autoLight\node_modules\yeelight-awesome\lib\yeelight.js:472:16)
at Yeelight.ping (E:\private\autoLight\node_modules\yeelight-awesome\lib\yeelight.js:446:21)
As far as I've tested/checked, it seems like the music mode is being correctly set, but using the lib's functions like setRGB() are not being sent through the TCP server.
Is there any workaround for that? Besides writing the raw commands and sending them using my own TCP server. Maybe a function to extract a raw command so we can just use that instead of writing by hand?
It would be nice if the lib could start it's own TCP server for each device and send the commands directly through it, if the device is in music mode.
Great package.
The yeelight-awesome sample worked fine in JavaScript but when I used TypeScript syntax
import {Discover, IDevice} from 'yeelight-awesome';
I'm told there is no declaration file.
I very much appreciate that the package is in TypeScript so I presume there is a simple npm install issue.
BTW, the instructions tell me I need to put the bulb into LAN mode. I didn't find the setting but, fortunately, it jus worked anyway. Maybe the app has been updated.
See here, IP scan is done on a timer.
https://github.com/samuraitruong/yeelight/blob/master/src/discover.ts#L128
Each IP scan will iterate over all the IPs:
https://github.com/samuraitruong/yeelight/blob/master/src/discover.ts#L76
Previous scan may still be in progress, a timeout takes at least minute on macOS and Android. The default interval is 200ms.
This results in each IP with no host behind it having 300 pending operations before the operation starts timing out. Roughly 60000 pending sockets (file descriptors) if 200 IPs are unavailable.
Suggested fix:
Keep track of the IPs being scanned, and filter that out in availabledIps.
Hi !
I can't make several function work in JS like setBright, scanByIp ...
here bellow a part of the code:
const yeelight = new y.Yeelight({lightIp: req.params.lightIp, lightPort: lightPort});
yeelight.connect().then((l) => {
l.setBright(req.params.brightness, req.params.effect, req.params.duration).then(() => {
l.disconnect();
return res.status(200).send("Set Brightness command successful");
});
}).catch((e) => {
return res.status(404).send(e);
});
Can someone help me ? please
Thanks
learning an hour documents is not as good as npm your yeelight. nice~ nice so much~ you are my yeelight. i love you...
Hi,
is it possibile to set a scene already created with phone?
Example:
I created the scene "Watch Movie" with my phone. It sets 2 lights on blue color and powers off 1 other light.
Is it possibile to activate the scene via this npm module?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.