Giter Club home page Giter Club logo

Comments (13)

kmpm avatar kmpm commented on June 18, 2024

And tdClose as well then I guess or how is that solved today?

from node-telldus.

Hexagon avatar Hexagon commented on June 18, 2024

Correct! That's not handled at all today

from node-telldus.

nilzen avatar nilzen commented on June 18, 2024

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.

nilzen avatar nilzen commented on June 18, 2024

http://www.telldus.com/forum/viewtopic.php?f=7&t=2188#p14262

from node-telldus.

Hexagon avatar Hexagon commented on June 18, 2024

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.

kmpm avatar kmpm commented on June 18, 2024

I'm all for running it automatically in the wrapper.

from node-telldus.

nilzen avatar nilzen commented on June 18, 2024

I agree.

from node-telldus.

Hexagon avatar Hexagon commented on June 18, 2024

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.

Hexagon avatar Hexagon commented on June 18, 2024

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.

kmpm avatar kmpm commented on June 18, 2024

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.

Hexagon avatar Hexagon commented on June 18, 2024

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.

kmpm avatar kmpm commented on June 18, 2024

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.

Hexagon avatar Hexagon commented on June 18, 2024

That should be entirely fine, great 👍

from node-telldus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.