GithubHelp home page GithubHelp logo

in node about node-red-contrib-marantz-http HOT 4 CLOSED

rikki78 avatar rikki78 commented on June 21, 2024
in node

from node-red-contrib-marantz-http.

Comments (4)

aborovsky avatar aborovsky commented on June 21, 2024

Hi, @rikki78! PRs are welcomed! How can i help you to finish "in-node" yourself?

from node-red-contrib-marantz-http.

rikki78 avatar rikki78 commented on June 21, 2024

Hi thanks for your reply
I've created two pull requests. To finish the in-node, all I need to know is on which event the state can be injected in the flows. I don't know where to start exactly. Perhaps you can point me in the right direction...

from node-red-contrib-marantz-http.

rikki78 avatar rikki78 commented on June 21, 2024

Hi @aborovsky
Could you give me some hints how to finish the node-in node?

edit: to be more exact, when will the node.receiveNotification be called?
https://github.com/estbeetoo/node-red-contrib-marantz-http/blob/master/marantz_http.js#L322

from node-red-contrib-marantz-http.

aborovsky avatar aborovsky commented on June 21, 2024

@rikki78 Current node use marantz-avr as driver library.
According to it's sources there is not way to receive notifications automatically on some event happens: https://github.com/estbeetoo/marantz-avr/blob/master/lib/avreciever.js

I propose to implement polling logic:

  1. Bind a listener after driver connected: fsm.on('connected', onConnected)
  2. Inside of onConnected start poll interval: const statusPoll = setInterval(requestStatus, 1000)
  3. inside of requestStatus(...) call const requestStatusPromise = fsm.connection.requestStatus(...);
  4. connection.requestStatus(...) returns Promise, so do that: requestStatusPromise.then(status => node.receiveNotification(status))
  5. also, don't forget to bind a listener on connection lost: fsm.on('disconnected', ()=> clearInterval(statusPoll))

from node-red-contrib-marantz-http.

Related Issues (4)

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.