Wow, I must say I was skeptical at first but its pretty cool how you put this together! I have always felt that home assistant's ways of doing UI / extensions / etc was extremely clunky and terrible, I still do. YAML templates for programming? Just.. no!
But after learning for a hour or two I did finally start to accomplish some tasks which was fun. Nothing crazy but I was happy and surprised how well the evaluation of the javascript templates works.
Aside from the whole order of evaluation - that is a nightmare. I would probably recommend you allow defining the variables as n array of key/value pairs and that they are evaluiated in that order -- or similar if the actual ordering gets lost in translation.
Anyway, my actual accomplishment is just a simple stateful button but I was very happy to see the group expansion so that my currentState ACTUALLY loops like 16 entities to determine the actual state of the room.
Might I suggest you expose this._entities which is the final expanded entities from the groups in the triggers_update.
It would be nice to be able to define triggers_update as an array rather than needing to re-expand the array (like i do with the .shift() calls).
Perhaps either just running arr.flat() on the list since it should never have depth to it, or something like ...[[[ which sounds more difficult to provide.
Wow, I must say I was skeptical at first but its pretty cool how you put this together! I have always felt that home assistant's ways of doing UI / extensions / etc was extremely clunky and terrible, I still do. YAML templates for programming? Just.. no!
But after learning for a hour or two I did finally start to accomplish some tasks which was fun. Nothing crazy but I was happy and surprised how well the evaluation of the javascript templates works.
Anyway, my actual accomplishment is just a simple stateful button but I was very happy to see the group expansion so that my
currentState
ACTUALLY loops like 16 entities to determine the actual state of the room.this._entities
which is the final expanded entities from the groups in thetriggers_update
.triggers_update
as an array rather than needing to re-expand the array (like i do with the.shift()
calls).arr.flat()
on the list since it should never have depth to it, or something like...[[[
which sounds more difficult to provide.