Comments (4)
Hi, @rikki78! PRs are welcomed! How can i help you to finish "in-node" yourself?
from node-red-contrib-marantz-http.
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.
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.
@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:
- Bind a listener after driver connected:
fsm.on('connected', onConnected)
- Inside of
onConnected
start poll interval:const statusPoll = setInterval(requestStatus, 1000)
- inside of
requestStatus(...)
callconst requestStatusPromise = fsm.connection.requestStatus(...);
connection.requestStatus(...)
returns Promise, so do that:requestStatusPromise.then(status => node.receiveNotification(status))
- 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)
- Get status from AVR HOT 1
- Node-red not working anymore HOT 1
- vollevel not working? HOT 2
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-red-contrib-marantz-http.