Skip to content
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

New button outputs & unload nodes #412

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

FredBlo
Copy link
Contributor

@FredBlo FredBlo commented Nov 18, 2022

Hi @Foddy ,

While I was using the 'Buttons' node, I noticed I always had to include quite many other nodes in the flow to be able to differentiate which button was used, which press,...
So I often had such flows right at the start before being able to really add the 'action' nodes:
image

I already encountered such situation in I node-set I built (domotic control for Legrand/Bticino MyHome, node-red-contrib-myhome-bticino-v2) where I added a way to easily configure buttons range and action type (short press, long press, repeat,...). Since expected behaviour seemed quite similar to me, I looked into how nodes were built and re-integrated this mechanism directly in the node.
As a result, new outputs can be defined to simplify flows, such as :
image

The primary output remains as it was, additional outputs are configured as an option, which makes it backward compatible.
image

Note: when testing this out, I also found out that nodes, on re-deploy, remained kind of active (=all listeners to the bridge were not removed, which resulted in the node receiving x times (1 per re-deploy) bridge-triggered events, until server was restarted)
I modified the bridge part to manage listeners so that they are kept in memory for a later removal. The bidge now has an '.unsubscribe' method to remove node's listeners, which all nodes now call on '.close'.

I thought it could be interesting to merge it in master branch :-)

* HUE Buttons : multiple output config

* HUE Buttons : multiple output config

* HUE Buttons : multiple output config - multilingual

* HUE Buttons : multiple output config - multilingual

* HUE Buttons : multiple output config - multilingual

* HUE buttons : avoid undefined (never opened) rules

* HUE Bridge : added cleaning on listereners on unload

* Remove debug code
mauricedominic added a commit to mauricedominic/node-red-contrib-huemagic that referenced this pull request Nov 19, 2022
FredBlo and others added 2 commits September 29, 2024 10:24
* Update api.js

* Update package.json

* Update CHANGELOG.md

* Update messages.js

* Update messages.js

* Update CHANGELOG.md

* Update README.md

* Update CHANGELOG.md

* Update README.md

* Update package.json

* Update README.md

* Update README.md

* Merged pull request Foddy#409 from FredBlo

* Update README.md

* Merged pull request Foddy#412, New button outputs & unload nodes from @FredBlo

* Update package.json

updated dependencies

* Added incrementBrightness support for groups

* version 4.2.6

* Update and rename bug_report.md to bug_report.yaml

new bug report format

* Update bug_report.yaml

updated bug template

* Added decrementBrightness Support for groups (#5)

* Added decrementBrightness to groups

* Updated documentation on decrementBrightness

* add terminal migration description (Foddy#9)

* added Support for Hue Tap dial switch (Foddy#10)

* added Support for Hue Tap dial switch

* corrected deepscan issues

* version 4.2.7

* version 4.2.8

---------

Co-authored-by: mauricedominic <[email protected]>
Co-authored-by: mauricedominic <[email protected]>
Co-authored-by: Julian Friedrich <[email protected]>
Co-authored-by: bond2k <[email protected]>
Co-authored-by: Reto <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant