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

add dark/light mode natively, supported from 2021.06 #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

basnijholt
Copy link
Owner

@basnijholt basnijholt commented Jun 4, 2021

I am implementing the new native light/dark mode.

https://www.home-assistant.io/blog/2021/06/02/release-20216/#support-for-custom-dark-mode-themes

https://www.home-assistant.io/integrations/frontend/#service-set_theme

However, currently I think I am experiencing a bug. Can anyone confirm that this doesn't work:

service: frontend.set_theme
data:
  name: default
  mode: light

where as:

service: frontend.set_theme
data:
  name: default
  mode: dark

does work...

@woutervanoorschot
Copy link

Awesome that you are working on automatic dark mode!

I believe (as far as I have knowledge about the themes) the set_theme function sets a theme for the state (dark or light) that home assistant is in.

I have called the service once to set a theme for dark mode, and once for the preferred theme in light mode. These themes are then used when selecting dark/light mode in settings, or when the OS/browser theme changes and the theme mode is 'auto'.

So it isn't related to the new dark+light themes, I think it was added to allow for different dark/light themes for the time being (before implementing and releasing the new dark+light themes)

Hope this can help, and I'm looking forward to dark+light mode ios themes!

@@ -10,20 +10,13 @@
A generalized version of [*iOS Dark Mode Theme*](https://github.com/basnijholt/lovelace-ios-dark-mode-theme)!
This includes both **Dark and Light Mode** and 7 different HomeKit backgrounds.
Installing this theme adds 28 different themes:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

28 you say...

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you counting up to some different number?

@broyuken
Copy link

I went ahead and modified your config to have full support for automatic dark mode. Would you like the file? Also for your original question I've found that you have to make 2 service calls to set the theme. One for if its in light mode, another for if its in dark mode. So as I have mine set up with no automations I have the light blue theme set for when I have a device in light mode, and dark blue when I have a device set to dark mode.

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