Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: πŸ§‘β€πŸ’» Allow users to use jinja-templates to display first tab dynamically #105

Closed
wants to merge 2 commits into from

Conversation

spasma
Copy link

@spasma spasma commented Jun 20, 2023

Hey @kinghat, πŸ‘‹

Thanks for creating this awesome card! I missed the feature to dynamically show the tab, as I have some dynamic content for morning, afternoon and evening.

I also saw this discussion: #70

For example I now use:

type: custom:tabbed-card
options:
  defaultTabIndex: '{% if now().hour > 17 %}2{% elif now().hour > 12 %}1{% else %}0{% endif %}'

to show different tabs by default based on the time of the day.

I've tested the old behaviour and all is still working. Please consider merging this PR.

Keep up the good work. πŸŽ‰

Sebastiaan

@ilearn2023au
Copy link

seems to be not working now.

@spasma
Copy link
Author

spasma commented Aug 23, 2023

It is working, but the JS in Home Assistant is cached for a long time. You cannot force to refresh it. After a while it will work.

Upgrade to latest version
@spasma spasma closed this Oct 24, 2023
@kinghat
Copy link
Owner

kinghat commented Oct 24, 2023

i still want something like this so hopefully you would be willing to collaborate on it and reopen in the future.

@spasma
Copy link
Author

spasma commented Oct 24, 2023

i didn't hear anything from you in 4 months, so I changed it to a fork of your repo: https://github.com/spasma/tabbed-card-programmable

On some devices the cached js was still an issue on my HA-instance (even after core updates) as mentioned here: #105 (comment), and I got bothered with updates to your repo. so I needed a solution for that asap.

@kinghat
Copy link
Owner

kinghat commented Oct 24, 2023

i didn't hear anything from you in 4 months, so I changed it to a fork of your repo: https://github.com/spasma/tabbed-card-programmable

On some devices the cached js was still an issue on my HA-instance (even after core updates) as mentioned here: #105 (comment), and I got bothered with updates to your repo. so I needed a solution for that asap.

ya thats fine. im not saying its going to happen soon:tm: but i will eventually want to add dynamic templates to areas of the card. when the time comes, if youre still willing, i'd gladly accept your help.

@spasma
Copy link
Author

spasma commented Oct 24, 2023

yes, of course! no plans to add other features to it at the moment, but will keep it in sync with your changes for now. let me know if i can help anytime

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants