Comments (13)
And tdClose as well then I guess or how is that solved today?
from node-telldus.
Correct! That's not handled at all today
from node-telldus.
I've read somewhere, can't find where now, that tdInit() only should be called once. So I guess that there should be an function that checks a boolean that is indicating if the Tellstick is initialized or not, and that function should be called in each of the "command functions".
Not sure when/where we should call tdClose(), I guess you normally never "shut down" node app.
from node-telldus.
http://www.telldus.com/forum/viewtopic.php?f=7&t=2188#p14262
from node-telldus.
Yeah that's a problem, we need to decide if we wan't to leave the tdInit call to the user, via telldus.tdInit(callback) or if we want to make logic in the js-wrapper that run tdInit on the first call and never again. The latter version is imho the cleanest option, and the first option is the most "library-agnostic".
from node-telldus.
I'm all for running it automatically in the wrapper.
from node-telldus.
I agree.
from node-telldus.
Agreed :) I'll add the core c++ stuff later, after that you'll be able to call telldus.tdInit(callback); (and close, if needed)
from node-telldus.
Untested as i dont have access to my tellstick right now. Short documentation in commit description, did not change telldus.js to avoid merge conflicts.
from node-telldus.
I have now tested, using my own changes to telldus.cc and .js, with and without tdInit/tdClose and I really can't make out any difference...
Anyone got anything.
from node-telldus.
I know nothing, seems like some people use init and close to successfully restart the library on failures. Telldus documentation says that tdInit "initializes the library", so i guess the best bet is to run it for compability with future versions.
from node-telldus.
tdInit is now called on module load.
tdClose on process exit.
Don't know if it's the best way of doing it but it seems to work.
from node-telldus.
That should be entirely fine, great 👍
from node-telldus.
Related Issues (20)
- Implementing deviceChangeEvent HOT 2
- Crashes node app HOT 30
- Tellstick.conf parser HOT 2
- telldus-core.h missing HOT 8
- Update instructions for Windows HOT 1
- Does not (always) exit on error
- OSX HOT 6
- Sending two commands at the same time HOT 1
- Does not work with Node.js 0.12 HOT 8
- Installation fails on node-gyp HOT 9
- Is the deviceID really working on addSensorEventListener? HOT 1
- Node process exits when it should wait for events... HOT 3
- Problems installing after upgrading node 0.10.41 -> 4.2.6 HOT 2
- No really an issue, but a question of best practice HOT 2
- Unable to install on Windows HOT 8
- nodejs segfault error 15 in libuv.so.1.0.0 HOT 11
- (Not a bug) listeners never reports first "Device ON" after "Device OFF" HOT 2
- Generates warning on npm install HOT 1
- node install fails on node 12
- Problem to Install on Raspberry Buster, Node 14.18 and node-gyp 5.1 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-telldus.