Support multiple consecutive underscores in an entity id #900
-
I have devices which exists on the threshold of 2 rooms, I name these devices using the names of both rooms, to allow me to easily identify which specific device I'm working with I use the following format:
If I didn't have the dash then the name is much harder to understand at a glance, for example For these devices the entity id is generated to something like I tried to use multiple consecutive underscores to signify the separator to make the entity id easier to read, but it seems that this is invalid (🤔), for example: So my question is:* Is this choice to limit consecutive underscores by design? I can't think of a reason why this might be an issue... well, actually I can - maybe it's somehow related to escaping the string, or maybe it's not valid in some intermediary format that HA needs to support, or maybe it's related to this: https://www.scaler.com/topics/double-underscore-python/# (in which case, validating that only the entity id doesn't start with a double underscore would be more appropriate?) Is there an appetite to relax the validation to allow multiple consecutive underscores to provide more freedom to end users in naming patterns? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
There is some history to be found around this:
The main gist is that this is used for more than entity IDs. I'm not entirely against the proposed change, but it would require more research from you to ensure the above-listed issues (and possibly new ones) are handled. That said, of course, an entity ID cannot/may not start with a double underscore, but the relaxing could happen for mid-string. What have been your findings thus far? ../Frenck |
Beta Was this translation helpful? Give feedback.
-
Thanks @frenck - I only stumbled across this issue this morning. I'll do try to do some research and come back to this thread with some results. I assume I would need to remove the validation in my local instance, start naming things with double underscore and then test against the issues described above to get some traction on this? Is that what you're looking for? |
Beta Was this translation helpful? Give feedback.
-
We discussed this proposal in our architectural core meeting and decided not to proceed with it. While it might be possible, we don't think we want to take the risks and effort involved for the arguable small gain this brings. Therefore, want to keep the existing boundaries of entity ID naming. ../Frenck |
Beta Was this translation helpful? Give feedback.
We discussed this proposal in our architectural core meeting and decided not to proceed with it.
While it might be possible, we don't think we want to take the risks and effort involved for the arguable small gain this brings. Therefore, want to keep the existing boundaries of entity ID naming.
../Frenck