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

feat(area-card): Adding new area/room summary card #1624

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

dmick92
Copy link

@dmick92 dmick92 commented Jan 8, 2025

Description

Added an area card with support for configurable chips.
image
image

Area card chips are a clone of the functionality provided by the Chips card. The chips in the Area card are restricted to light entities and generic entities. The card currently only supports 4 chips due to screen sizes, although could be updated to remove the restriction or add a override toggle.

Related Issue

This PR fixes or closes issue: fixes #55

Motivation and Context

The card request dates back a couple years and I wasn't happy with the need to use another library or yaml editing to achieve the desired results. Due to the GUI focused nature of Mushroom Cards rather than yaml editing, and my personal desire along with the communities to have a area/room card, this feels like a solid addition to the repo.

How Has This Been Tested

All Changes are isolated to the new card and don't affect other aspects of the code base.

Card was built and tested using the development image of hass provided by the repo.

Types of changes

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • 🚀 New feature (non-breaking change which adds functionality)
  • 🌎 Translation (addition or update a translation)
  • ⚙️ Tech (code style improvement, performance improvement or dependencies bump)
  • 📚 Documentation (fix or addition in the documentation)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have tested the change locally.
  • I followed the steps if I add a new language .

Implement the AreaCardEditor component for managing area card 
configurations. This includes defining a form schema for area, 
appearance, and interactions, and handling configuration changes 
through events. The component enhances user experience by 
providing a structured interface for editing area card settings.
Adds the HaFormExpandableSchema interface to enhance form 
abilities.
Remved accidental addition of code being used as an idea.
@dmick92 dmick92 changed the title Area card feat(area-card) Jan 8, 2025
@dmick92 dmick92 changed the title feat(area-card) feat(area-card): Adding new area/room summary card Jan 8, 2025
@dmick92
Copy link
Author

dmick92 commented Jan 11, 2025

@piitaya I'm having some trouble defaulting the chip content into to "none". I've set the getStubConfig for the chips but when a new chips is added it's still defaulting to "state".

Any change you could shed some light one this?

 public static async getStubConfig(
    hass: HomeAssistant
  ): Promise<LightChipConfig> {
    const entities = Object.keys(hass.states);
    const lights = entities.filter((e) => e.split(".")[0] === "light");
    return {
      type: `light`,
      entity: lights[0],
      content_info: "none",
    };
  }

@dmick92
Copy link
Author

dmick92 commented Jan 11, 2025

Never mind, realized that when the chip was being added it wasn't using the correct prefix and was using the chip card stubs.

@dmick92 dmick92 marked this pull request as ready for review January 11, 2025 00:34
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.

Room summary card
1 participant