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

Lovelace: Allow glance card to assume theme colors #1732

Merged
merged 4 commits into from
Oct 5, 2018
Merged

Lovelace: Allow glance card to assume theme colors #1732

merged 4 commits into from
Oct 5, 2018

Conversation

thomasloven
Copy link
Contributor

@thomasloven thomasloven commented Oct 3, 2018

Edit: Documentation added: home-assistant/home-assistant.io#6506

This change lets the glance card act like color-glance-card.

For now a sample config looks like this:

- type: glance
  themed: true
  entities:
    - light.bed_light

I'm not sure about the name of the config variable, though, and as @balloob pointed out in discord, making it a boolean means values can't be added later.

Posting this as a WIP, hoping for ideas and advice.

@ghost ghost added the in progress label Oct 3, 2018
@balloob
Copy link
Member

balloob commented Oct 4, 2018

I am not a fan of boolean config options as they don't usually hold well. Can we do something like: theming: default/primary/secondary?

@thomasloven
Copy link
Contributor Author

thomasloven commented Oct 4, 2018

theming: is a good idea, and extensible:
glance theming

All colors are from the current theme, btw.
But some (like --accent-color) are probably not implemented by all themes.

@thomasloven
Copy link
Contributor Author

thomasloven commented Oct 4, 2018

Fewer choices, yet more...
theming2

- type: glance
  theming: primary
  entities: ...

- type: glance
  theming:
    background: rgba(0, 110, 128)
    text: white
    icons: var(--accent-color)
  entities: ...

May be a bit confusing that theming can be either a string or a map though.

@balloob
Copy link
Member

balloob commented Oct 4, 2018

I think that we should not allow theming to be a dict. Let's start very small, see what use cases are coming up .

@thomasloven
Copy link
Contributor Author

just primary

- type: glance
  title: default
  theming: default
  entities: ...

- type: glance
  title: primary
  theming: primary
  entities: ...

- type: glance
  title: none
  entities: ...

@thomasloven thomasloven changed the title WIP: Lovelace: Allow glance card to assume theme colors Lovelace: Allow glance card to assume theme colors Oct 4, 2018
@balloob
Copy link
Member

balloob commented Oct 4, 2018

Can you add the theming = primary to one of the demo glances? https://github.com/home-assistant/home-assistant-polymer/blob/master/gallery/src/demos/demo-hui-glance-card.js

@balloob
Copy link
Member

balloob commented Oct 4, 2018

🐬 🎉

@iantrich
Copy link
Member

iantrich commented Oct 4, 2018

@balloob I need to know what 🐬 🎉 means 😄

@thomasloven
Copy link
Contributor Author

approval dolphin

@iantrich
Copy link
Member

iantrich commented Oct 4, 2018

image

@balloob balloob merged commit 362e758 into home-assistant:master Oct 5, 2018
@ghost ghost removed the in progress label Oct 5, 2018
balloob pushed a commit to home-assistant/home-assistant.io that referenced this pull request Oct 5, 2018
zsarnett pushed a commit to zsarnett/home-assistant-polymer that referenced this pull request Oct 13, 2018
* Allow glance card to assume theme colors

* Better configuration options

* Added example to gallery

* Fixing problems from review
zsarnett pushed a commit to zsarnett/home-assistant-polymer that referenced this pull request Oct 13, 2018
* Allow glance card to assume theme colors

* Better configuration options

* Added example to gallery

* Fixing problems from review
zsarnett pushed a commit to zsarnett/home-assistant-polymer that referenced this pull request Oct 14, 2018
* Allow glance card to assume theme colors

* Better configuration options

* Added example to gallery

* Fixing problems from review
zsarnett pushed a commit to zsarnett/home-assistant-polymer that referenced this pull request Oct 14, 2018
* Allow glance card to assume theme colors

* Better configuration options

* Added example to gallery

* Fixing problems from review
@github-actions github-actions bot locked and limited conversation to collaborators Jul 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants