hassio-addons / addon-node-red

Node-RED - Home Assistant Community Add-ons
https://addons.community
MIT License
513 stars 117 forks source link

"Expose as" on any node that supports it is defaulting to the first switch in existing list rather than "none" #1900

Closed dpgh947 closed 3 days ago

dpgh947 commented 6 days ago

Problem/Motivation

I use the "expose as" function of various nodes (EG: the events-state node) a lot. It provides a switch in home assistant that can be used to easily enable/disable a node red routine. I have just noticed (can't say for sure but I assume since updating to node red 4) that when editing a new node, this "expose as" setting is now defaulting to the first existing switch in the list, rather than "none".

Expected behavior

When editing a new node it should default to none.

Actual behavior

It is defaulting to the first existing value in the list.

Steps to reproduce

Drag an events-state node to a flow and edit it. Look at the bottom, "expose as" should be defaulting to none. But note, if you have never used this "expose as" facility before then you won't have any switches set up and "none" will be the only value there. Create a switch and deploy, and then edit another new node and you should see the problem.

Proposed changes

dpgh947 commented 5 days ago

This is a node red bug, it affects all config dropdown lists that have "none" as an option - see here https://discourse.nodered.org/t/home-assistant-node-status-disabled/88858

dpgh947 commented 4 days ago

It was the "New Config Node selection UI" touted in the v4 release announcement that caused this. It has been (allegedly) fixed in node red, how does that update get across to the addon?

dpgh947 commented 3 days ago

I may have not remembered how this worked prior to v4, maybe "none" wasn't there before, but in any case it seems there is still a problem in how the change to this was made - the original change has been re-opened https://github.com/node-red/node-red/pull/4627

frenck commented 3 days ago

Closing this on this end, as this is not an add-on specific issue, but an issue with the upstream software.

../Frenck

dpgh947 commented 3 days ago

OK I understand but how do we get the fix in the addon when they finally fix the problem in node red?

frenck commented 3 days ago

If upstream ships updates, the add-on will update after it. We have a bot that will create PRs automatically. once that has been merged and tested against our supported architectures, it will be shipped.

meks007 commented 2 days ago

Upstream released 4.0.1 that contains a fix https://github.com/node-red/node-red/pull/4800

frenck commented 2 days ago

@meks007 no need to report that, but thanks 👍

../Frenck