-
Notifications
You must be signed in to change notification settings - Fork 307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Subscribe node to all properties #62
Comments
What about a 4th parameter in the
|
yeah, that would work nicely! |
Great! |
Will land in v1.4.0. :) |
Hi Marvin I'm not a c dev, but I think the new changes could result in the property handler getting called twice. I've added a commend to the check in. |
In fact the https://github.com/marvinroger/homie-esp8266/blob/master/docs/3.-Advanced-usage.md suggests that the node input handler should handle every changed property of a specific node, but at the minute it doesn't. The same way the global input handler will not be called unless there is at least one subscription on that node. An alternative could be to move 2bc6c8d#diff-ee62c9806128c2e2d545222f1f62952aR255 doewn below the global input handler, and the node property handler call? That way you wouldn't need the subscribe all stuff (and it would more closely match the docs at the minute) |
I am not sure I understand what you mean. It handles every changed property of a specific node, if this property is registered. In your case, it will be called since you will use a node that is subscribed to all properties. |
And the property handler is called once, why would it be called twice? |
Had another look through, and I totally get it now! This is a great solution, thanks. |
You're welcome! :) |
@rossdargan before I release, can you test if it works for you? I added a |
Sure thing (It may be Saturday night now though I'm afraid!) |
No problem. 😄 |
Hello, thanks for the great work on this, not OP, but i figured i would give this a shot (already have a sous vide cooker going with the homie library) and it looks to be working well. Here is the code i am using: |
Thanks a lot for your feedback! Glad to hear it is stable for you. |
Tested, and all working for me - fab! Here is my project https://github.com/rossdargan/Arduino-Projects/blob/master/HomieSwitch/HomieSwitch.ino |
Awesome, I guess it's ready for prime-time, then. :) |
Released! |
I am wanting to use the node input handler as I'm planning on controlling a set of switches. The property will relate to the switch, and the value will tell me if it is on or off.
My code looks like this:
Now I think my issue is that I'm not calling Homie.Subscribe("property",rcSwitchOnHandler) but I want to allow any property to be sent through really (well a number from 1->14).
This is the error homie gives me:
Thanks for this wonderful library!
The text was updated successfully, but these errors were encountered: