How can I set an "element template" for a list of entity IDs? #231
ndbroadbent
started this conversation in
Ideas
Replies: 1 comment 4 replies
-
It looks like this could be solved by using
Then it would support JS code starting with |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Related: #159
I'm designing a floorplan in Figma and it doesn't allow me to re-use the same ID. Sometimes I have multiple things in my SVG that control or display the same entity. I want to be able to add a prefix to the element ID, and define a template string (or JS function) that ha-floorplan will use.
Example:
I have some "hotspots" in my floorplan that are clickable rectangles to control certain lights. I want to prefix these IDs with "hotspot":
I also use those light entity ids in a different place:
So I want to be able to do this in my config:
I tried a few other ways but I get:
I also tried to specify a list of elements, but that crashes with an error: "A rule cannot contain both 'entities' and 'elements' in floorplan configuration."
The
entities
array is handy, but feels a bit restricted since I don't have any control over the SVG element IDs.Is there any templating or JS I can use to solve this?
Beta Was this translation helpful? Give feedback.
All reactions