Skip to content

Conversation

patrickli
Copy link

Fixes #6

patrickli added 2 commits May 3, 2023 19:43
This way the selected values can be restored after HA restart.
@deviantintegral
Copy link

I tried this out and it doesn't seem to be working for me. When I restart the setting still flips back to lovelace. @patrickli can you confirm that if you log in with a private browsing session that you get redirected?

I forked the repo and merged this in for testing, in case anyone else wants to try: https://github.com/deviantintegral/default-dashboard

Also, the actions in this repo use the latest nodejs release, and it looks like builds are broken on node 18.

@patrickli
Copy link
Author

I actually can't reproduce this right now. Despite restarted HA a few times the redirection to set the default dashboard on the first login always works. It's annoying that you have to login a couple of times if "remember me" is not selected but that's a different issue.

@deviantintegral
Copy link

deviantintegral commented Jul 3, 2023

I figured out the issue. I didn't really understand this PR. If you start with the released version, create the input select, and then switch to this PR, the initial value isn't changed. You can either recreate the input_select, or edit config/.storage/input_select and remove initial.

I have a few tags now as I was debugging this. The best one for others to test is https://github.com/deviantintegral/default-dashboard/releases/tag/1.1.2-fix-builds.

@patrickli
Copy link
Author

Yes that's right. I probably have manually edited the input_select file so I can't reproduce this now.

But if you are on the release version this bug should be there.

@deviantintegral
Copy link

I have two HA installs, and was having real difficulty with the second one.

I noticed in the one that was working that .storage/input_select had the list of dashboards set as options. Yet, in the one that wasn’t, the only option was refresh. It’s as if calling input_select.set_options was only saving it in memory and not persistently. From looking at the docs, I see no reason to think that it shouldn’t be persistent: https://www.home-assistant.io/integrations/input_select/#services

@daredoes
Copy link
Owner

daredoes commented Jul 6, 2023

I just noticed this activity. I will look at this soon and get a new versions out there. Thanks for all the work!

@daredoes
Copy link
Owner

daredoes commented Jul 6, 2023

So I think the appropriate way to handle this is to modify the function that creates the input select and boolean toggle automatically for the user. Perhaps it is not effectively checking if these already exist, and thus resetting the existing input select instead of skipping the creation step.

https://github.com/daredoes/default-dashboard/blob/main/src/default-dashboard.ts#L75

@patrickli
Copy link
Author

So I think the appropriate way to handle this is to modify the function that creates the input select and boolean toggle automatically for the user. Perhaps it is not effectively checking if these already exist, and thus resetting the existing input select instead of skipping the creation step.

https://github.com/daredoes/default-dashboard/blob/main/src/default-dashboard.ts#L75

I didn't look too much into the creation process. But regardless, we need to remove the initial parameter so it won't get reset every time HA restarts.

@daredoes
Copy link
Owner

daredoes commented Jul 6, 2023

I see what you're saying. I'll test it out soon and give it a new release

shinypancake added a commit to shinypancake/dash-ing-default that referenced this pull request Sep 6, 2025
- Update all npm dependencies to latest compatible versions
- Fix duplicate entity creation issue (daredoes#10)
- Apply PR daredoes#7 fix for dropdown helper state persistence
- Fix default dashboard reset after restart (daredoes#8)
- Add retry logic for entity loading after HA restart
- Update to ES modules and modern build tooling
- Update maintenance shield to 2025
- Bump version to 1.1.0

Fixes daredoes#10, daredoes#8, daredoes#6
Implements daredoes#7

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
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.

Dropdown helper not keeping state

3 participants