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

Support for Mushroom cards #65

Closed
LordPsycho202 opened this issue May 23, 2023 · 10 comments
Closed

Support for Mushroom cards #65

LordPsycho202 opened this issue May 23, 2023 · 10 comments
Labels
enhancement New feature or request Regression Broken by another fix

Comments

@LordPsycho202
Copy link

Loving the idea behind this - it should simplify my lcars dashboard.

However, it would be nice if the mushroom cards could be supported - especially the mushroom chips card.

https://community.home-assistant.io/t/mushroom-cards-build-a-beautiful-dashboard-easily/388590

Thank you!

@th3jesta th3jesta added the enhancement New feature or request label May 30, 2023
@th3jesta
Copy link
Owner

Added in 2.2.

@LordPsycho202
Copy link
Author

Thank you!

@roberthawdon
Copy link

How do you configure these now? Mushroom cards looked fine before this update.

@th3jesta
Copy link
Owner

They should look okay if you remove whatever class you added to them. I didn't realize how many people were using them particularly with the middle- type classes. Now that I know this, I will be pushing a small update in the next 24 hours so that folks who already have classes applied won't have issues. If you want to roll back until I push the update, you won't have to modify anything on your dashboards.

@th3jesta th3jesta reopened this May 30, 2023
@th3jesta th3jesta added the Regression Broken by another fix label May 30, 2023
@th3jesta
Copy link
Owner

Just released 2.2.1. Many of the card configurations have been removed, as I realized it's a lot saner to control text color like the other HA cards: with classes. If you want your Mushroom cards to have black text, apply button-large or button-small to them. Chips cards will always be black text.

@roberthawdon
Copy link

image

Sorry, but is there any way to override the chip cards to use white text? Or is there a more recommended way to display them?

@th3jesta
Copy link
Owner

Are you applying any custom style to them to black out their backgrounds?

@roberthawdon
Copy link

Yes, I'm using "middle-blank" on each individual chip, I've posted a copy of one of my stacks below. It looks ok with the coloured background if I remove the class from each chip as the black text is readable.

type: vertical-stack
cards:
  - type: markdown
    card_mod:
      class: header
    content: >-
      # Node-RED

      Installed v{{ states('sensor.node_red_version') }} - Latest v{{
      states('sensor.node_red_newest_version') }}  
  - type: custom:mushroom-chips-card
    card_mod:
      class: middle
    chips:
      - type: entity
        entity: binary_sensor.node_red_running
        icon_color: green
        card_mod:
          class: middle-blank
      - type: entity
        entity: sensor.node_red_version
        icon_color: green
        icon: mdi:package-variant-closed
        card_mod:
          class: middle-blank
      - type: entity
        entity: sensor.node_red_cpu_percent
        icon_color: blue
        card_mod:
          class: middle-blank
      - type: entity
        entity: sensor.node_red_memory_percent
        icon_color: orange
        card_mod:
          class: middle-blank
  - type: custom:mushroom-update-card
    entity: update.node_red_update
    show_buttons_control: true
    icon_type: entity-picture
    layout: horizontal
    card_mod:
      class: middle
  - type: markdown
    content: '#  '
    card_mod:
      class: footer

@th3jesta
Copy link
Owner

th3jesta commented Jun 1, 2023

I see. So, I would consider removing the background of the chips to be an edge case since it fundamentally changes the intention of the original author, so I recommend trying this instead on each of your chips:

card_mod:
      style: |
        ha-card, .chips-container {
           --primary-text-color: var(--lcars-text-gray) !important;
           --text-color: var(--lcars-text-gray) !important;
        }
      class: middle-blank

I think this should work:

type: vertical-stack
cards:
  - type: markdown
    card_mod:
      class: header
    content: >-
      # Node-RED

      Installed v{{ states('sensor.node_red_version') }} - Latest v{{
      states('sensor.node_red_newest_version') }}  
  - type: custom:mushroom-chips-card
    card_mod:
      class: middle
    chips:
      - type: entity
        entity: binary_sensor.node_red_running
        icon_color: green
        card_mod:
          style: |
            ha-card, .chips-container {
               --primary-text-color: var(--lcars-text-gray) !important;
               --text-color: var(--lcars-text-gray) !important;
            }
          class: middle-blank
      - type: entity
        entity: sensor.node_red_version
        icon_color: green
        icon: mdi:package-variant-closed
        card_mod:
          style: |
            ha-card, .chips-container {
               --primary-text-color: var(--lcars-text-gray) !important;
               --text-color: var(--lcars-text-gray) !important;
            }
          class: middle-blank
      - type: entity
        entity: sensor.node_red_cpu_percent
        icon_color: blue
        card_mod:
          style: |
            ha-card, .chips-container {
               --primary-text-color: var(--lcars-text-gray) !important;
               --text-color: var(--lcars-text-gray) !important;
            }
          class: middle-blank
      - type: entity
        entity: sensor.node_red_memory_percent
        icon_color: orange
        card_mod:
          style: |
            ha-card, .chips-container {
               --primary-text-color: var(--lcars-text-gray) !important;
               --text-color: var(--lcars-text-gray) !important;
            }
          class: middle-blank
  - type: custom:mushroom-update-card
    entity: update.node_red_update
    show_buttons_control: true
    icon_type: entity-picture
    layout: horizontal
    card_mod:
      class: middle
  - type: markdown
    content: '#  '
    card_mod:
      class: footer

@roberthawdon
Copy link

Thanks, that works. I have gotten used to how it looks by default now, but it's good to know this option is available for future reference. Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Regression Broken by another fix
Projects
None yet
Development

No branches or pull requests

3 participants