Git Product home page Git Product logo

Comments (3)

Shaquu avatar Shaquu commented on August 23, 2024

@crxporter, indeed looks like we are storing topic and sending it later.

  1. Can you replicate?
  2. Is that a bug?

onInput
node.topic_in = msg.topic ? msg.topic : ''

onValueChange
const topic = node.config.topic ? node.config.topic : node.topic_in

from node-red-contrib-homekit-bridged.

crxporter avatar crxporter commented on August 23, 2024

Topic is always an interesting topic to discuss... see what I did there?

Anyway, what would the expected behavior be? I would expect:

For a pass-through message:
-if incoming message has no topic, the outgoing message would be (first choice) the config topic (if it exists), or (second choice) no topic
-if incoming message has a topic, the outgoing message would be the config topic (if it exists, overwrite the incoming topic) or the same as incoming message (if no config topic)

For messages originating in the node:
-messages should be the config topic if it exists
-if no config topic, I would expect outgoing messages to match whatever the most recent incoming topic was

This is the "normal" way for topic to work in nodered. I've seen other nodes use this convention. Based on the code, and bug report, I think this is what the node is doing?

I use topic a lot in my flows. I have the topic for everything homekit set in the node and haven't ever had issues.

In response to the bug report-
The config of the node is not being set by the incoming messages. Restarting nodered should wipe any previous "remembered" topic, unlike a config which will be remembered. It's just using the latest incoming topic if there's not any topic set by the config.

And now - does anyone have a reason it should work differently from how it is?

from node-red-contrib-homekit-bridged.

Shaquu avatar Shaquu commented on August 23, 2024

Closing as no update from author. Let's keep the topic feature as is for now, until any strong arguments appear.

from node-red-contrib-homekit-bridged.

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.