AlexxIT / WebRTC

Home Assistant custom component for real-time viewing of almost any camera stream using WebRTC and other technologies.
https://github.com/AlexxIT/Blog
MIT License
1.53k stars 180 forks source link

Access to user variable in Jinja template for url #420

Open Daniel-dev22 opened 1 year ago

Daniel-dev22 commented 1 year ago

The current Jinja implementation for the url field does not have access to the current user. The possibilities for this are endless. In my use case I would use it to check the users phone dahttps://github.com/piitaya/lovelace-mushroom/blob/main/src/cards/template-card/template-card.ts#L56ta/wifi signal and determine if it's sufficient for the mainstream url or requires the substream url.

Here's some documentation on this.

https://developers.home-assistant.io/docs/frontend/data/#hassuser

An example of this being used in the mushroom Template card.

https://github.com/piitaya/lovelace-mushroom/blob/main/src/cards/template-card/template-card.ts#L56

AlexxIT commented 1 year ago

This is not possible. Template rendered on server via Jinja. There is no information about user.