AalianKhan / mushroom-strategy

A strategy to automatically generate a dashboard using mushroom cards
MIT License
371 stars 37 forks source link

Make it possible to use type "area" for area cards instead of Mushroom template card #52

Closed punxaphil closed 11 months ago

punxaphil commented 11 months ago

What

This provides an option to use type: area instead of mushroom-template-card for Areas, by configuring use_ha_area_card: true. Along with that an option is also added to set common options for all area cards. Example:

strategy:
  type: custom:mushroom-strategy
  options:
    areas:
      _:
        use_ha_area_card: true

Of course it was already possible to override type in mushroom-strategy, but that wouldn't work with the type: area, since it also requires area: <area id>.

Why

Example

Example of how it can look:

image
punxaphil commented 11 months ago

@AalianKhan @ajagnanan @DigiLive would love to hear your input on this 😄

ajagnanan commented 11 months ago

I think it's a good addition! Is there a way to move the section header Areas to align in the right column with the areas? That's happening on my dashboards as well.

Edit: I see it's fixed with https://github.com/AalianKhan/mushroom-strategy/pull/50

DigiLive commented 11 months ago

@johanfrick Thank you for your effort in enhancing the strategy.

I do like the looks, but I have some objections also...

  1. It's called Mushroom Strategy, designed to auto-populate the dashboard with Mushroom cards, whenever useful and possible. I'm not sure we should mix all kind of card-styles together, but to keep it at a minimum instead.

  2. I.m.o., If adding support for the HA Area Card, the way to go is to add a new class to the package. The sole purpose of the current AreaCard class is to create a Mushroom-styled area card.

  3. Adding properties to the configuration is allowed, so the following example should work. (However, additional properties may be incompatible with Mushroom Strategy.)

    areas:
      biljardrum:
        type: area
        area: biljardrum
        navigation_path: biljardrum

My advice to @AalianKhan is to enable the discussions in the settings of this repository and talk about this request and/or poll the user's opinions in a dedicated topic.

punxaphil commented 11 months ago

Yeah, you make a fair point that this is a strategy for Mushroom cards. However, this is also the greatest strategy I've seen for Home Assistant and I think the crowd can be made a lot wider if we allow some more customisation. Many people prefer Mushroom cards and nothing else, but not everyone does. That being said, I'll give it another think how I can "hide" the intention of not using Mushroom card for some parts. Probably by moving more to the user's configuration of mushroom-strategy. But let me know if it is not worth the effort, and I'll move forward by only maintaining my own fork.

DigiLive commented 11 months ago

Locked to continue the discussion at #58

DigiLive commented 11 months ago

I've unlocked this PR so the commits can be discussed. Please discuss the more generic things in the discussion: #58

punxaphil commented 11 months ago

Please review again @DigiLive . I have updated the code according to your comments. I have also updated the README, and the PR description.

punxaphil commented 11 months ago

@DigiLive Ready for another review. I have updated according to your comments.

DigiLive commented 11 months ago

Please don't push any other commits as I'm reviewing and tweaking locally now.

I really want to avoid merge conflicts at this point.

DigiLive commented 11 months ago

@johanfrick Can you evaluate my code changes, please?

punxaphil commented 11 months ago

@DigiLive I have evaluated the code. It looks reasonable to me. I have also verified it by trying it out locally. I am happy to go forward with this solution. 👍

punxaphil commented 11 months ago

Anything else needed before merging?

maslyankov commented 6 months ago

This looks well if the rooms have no temp/humidity sensors. If there are sensors for an area, they show up in the area card and therefore the UI looks too narrow and bad. The easiest solution would be to make them appear in one column.