Skip to content

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

@erkr
Copy link

erkr commented May 10, 2025

@kinghat
Thanks for fixing your card so quickly for Core 2025.5.x. But please reconsider merging in this pull request. I was using the fork mentioned above, till is was broken by core-2025.5.x, so reverted back to your version.
It really adds value to dynamically template defaultTabIndex. I can confirm that feature was working great over the last year.
Best Eric

@spasma
Copy link
Author

spasma commented May 10, 2025

@erkr I will update my fork (the @EnkodoNL one) next Wednesday, I'm on holiday now πŸ™‚

@erkr
Copy link

erkr commented May 10, 2025

No hurry. Enjoy πŸ™

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.

4 participants