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

Wrong key label for theme modes #4

Closed
dylan09 opened this issue Aug 16, 2021 · 4 comments
Closed

Wrong key label for theme modes #4

dylan09 opened this issue Aug 16, 2021 · 4 comments

Comments

@dylan09
Copy link

dylan09 commented Aug 16, 2021

The key for switching between light and dark theme should be mode. I think modes is wrong.

In the documentation Frontend documentation in the samples the keyword 'modes' is used. But in the text and in the attribute list mode is listed as attribute key word.

After changing to mode the automatic change takes place. But the themes aren't rendered correct. In light theme the border is missing.
And in both themes (light and dark) the colors are missing. If I change back to modes only light theme is working. But than borders and colors are back.

I am running Home Assistant 2021.8.6 on docker.

@Paddy0174
Copy link

The correct naming is mode without an "s" at the end. :)

See here: https://github.com/home-assistant/core/blob/dev/homeassistant/const.py#L138

Why the colors and borders are not working, I'd need to check. Must be something, that is overwritten in one of the mode sections. The reason why it is working with modes is, that because of the use of the wrong naming, this part won't be parsed...

I'll see if I come up with something.

@dylan09
Copy link
Author

dylan09 commented Aug 17, 2021

Interestingly, the contents of the file mobile_light.yaml is used even if the wrong keyword is used. So it is using it as default?
With the misspelled keyword the 'mobile_light.yaml' is parsed and everything is displayed correct. Also, if I change the file name to 'mobile_dark.yaml', everything is displayed correctly using the dark theme.

I will try to include all definitions into the mobile.yaml (without the includes). Maybe it will work that way and the includes aren't working correct.

@dylan09
Copy link
Author

dylan09 commented Aug 17, 2021

So. After doing a lot of tests I have found:
The keyword modes seems to be correct. But everything I have tested: I couldn't get the theme to change between light and dark.

The key is defined in frontend code homeassistant/components/frontend/__init__.py.

@dylan09
Copy link
Author

dylan09 commented Aug 17, 2021

Uups. My fault. After checking again for any error or mistyped key I have found the reason.
I had the theme defined in my views. After deleting the theme definition from my view definitions, automatic switching works.

@dylan09 dylan09 closed this as completed Aug 17, 2021
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

No branches or pull requests

2 participants