Open cooperised opened 10 months ago
On further investigation, this information is available to JavaScript via the hass
object, e.g. as hass.user.name
. Other template cards, for example the Mushroom template card, make this available explicitly as a user
variable by passing it to the template renderer. (This is my first time reading the code for any custom cards, so my terminology may be wrong!)
Not sure how to create the other variables but user
should be doable with a one-line change to TailwindTemplateCard.tsx. I'll have a play around and submit a PR if I'm successful.
Usually, cards that support jinja templates have access to four special variables:
user
,browser
,config
andhash
. (The important one to me isuser
, to customise the card based on who is viewing it.) These are all undefined if used in the tailwindcss-template-card. Is there an easy fix for this?