Accessing and changing different elements style properties with different values #60
-
Hi - I think the answer to this might be not possible but just thought I'd check. My use case is that I have 3 different colour overlays for a room taken from floorplanner, Red, Green, And Blue. I had some custom code in the previous version which would look at the state of the colour lights and apply an opacity level to each layer. Works quite well. So I was wondering if and how I could replicate this without custom code. it would need a function like:
Is it possible to get a domElement within configuration code e.g. An alternative I thought of is the return value to class_set or style_set could contain an array, eg:
But I'm not sure how feasible or useful you'd consider that. Thanks for looking :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Hi @Alfiegerner Not sure if it's applicable in your scenario, but I wonder if the Light example contains the sort of code you require. https://experiencelovelace.github.io/ha-floorplan/docs/example-light/ As you can see in that example, the BTW, as you noticed, direct access to the DOM is not supported (due to sandboxing), so the best you can do is tell floorplan which DOM element you want to update via floorplan rules. Let us know if that helps. |
Beta Was this translation helpful? Give feedback.
Hi @Alfiegerner
Not sure if it's applicable in your scenario, but I wonder if the Light example contains the sort of code you require.
https://experiencelovelace.github.io/ha-floorplan/docs/example-light/
As you can see in that example, the
service_data
is evaluated dynamically, and the returns value contains the target DOM element(s) to be used for the call tofloorplan.style_set
.BTW, as you noticed, direct access to the DOM is not supported (due to sandboxing), so the best you can do is tell floorplan which DOM element you want to update via floorplan rules.
Let us know if that helps.