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

Create visual editors for decluttering cards and templates. #78

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

j9brown
Copy link

@j9brown j9brown commented Mar 16, 2024

The new 'custom:decluttering-template' card declares a template. It can be placed in any view of the dashboard and it is only visible in edit mode. Use the visual editor to conveniently create a template, configure the card or element, set variables with their default values, and preview the results.

The existing 'custom:decluttering-card' card now searches for templates declared by 'custom:decluttering-template' cards in addition to those in the traditional decluttering_templates dashboard configuration. Use the visual editor to conveniently pick an existing template defined elsewhere, set variables, and preview the results.

Fixed possible race conditions when cards are loaded and streamlined the logic.

Restored previously set styles when element styles are modified. The element styling behavior is curiously undocumented...?

The new 'custom:decluttering-template' card declares a template. It can
be placed in any view of the dashboard and it is only visible in edit
mode. Use the visual editor to conveniently create a template, configure
the card or element, set variables with their default values, and preview
the results.

The existing 'custom:decluttering-card' card now searches for templates
declared by 'custom:decluttering-template' cards in addition to those
in the traditional decluttering_templates dashboard configuration. Use
the visual editor to conveniently pick an existing template defined
elsewhere, set variables, and preview the results.

Fixed possible race conditions when cards are loaded and streamlined
the logic.

Restored previously set styles when element styles are modified.
The element styling behavior is curiously undocumented...?
Represent each type as an abstract thing instead of pretending they are all
cards. Choose the correct editor for each type (when one is available).

Decluttering cards can now be safely embedded within entities cards as
entity row and within picture-elements cards as elements.
@badbl0cks
Copy link

Maintainers, can this be merged? It adds more functionality and also fixes #80, making this compatible with the new sections view type (just have to set the layout size on the template card)!

@werehamster999
Copy link

@j9brown - This is awesome and exactly what’s needed. I hope the original author picks up on this and merges it soon. I can’t wait to try it out.

PS: The devil’s advocate in me says “stencil” is a better name to use for the templates (Only because the HA team haven’t worked out the difference that decluttering-card brings to the table and it’ll be less confusing to use in discussion) :-)

@j9brown
Copy link
Author

j9brown commented Aug 4, 2024

I'm glad you like it. I'm somewhat tempted to hard fork the project and publish a new version under a different name and I'd like to contact the original author before I do that.

There are a bunch of changes needed to support new features in Home Assistant 2024.8, so expect to see those in my fork once I find some free time.

That said, I do think that this "stencil" abstraction would be better off implemented directly within Home Assistant. It could also be considered a "blueprint" for cards and badges and other dashboard objects.

@werehamster999
Copy link

@j9brown - Hi Jeff! Thanks for the response. Yeah, it’s a bit awkward not getting a response yet. Hopefully the author is okay and just busy. I believe the HASS agent integration had a similar situation crop up.

As long as the release is respectfully done as a fork/variant then I’m sure the author will understand. A little free field-testing and feedback prior to a merge might be useful to the author too.

If you do a fork, you’re guaranteed one visitor. I have enough custom cards to keep me busy in other ways. The decluttering card helped so much at keeping them neatly (and DRY-ly) in line :-).

As for “stencil”, yeah, it’s not a strong advocacy thing :-), it’s just a thought. I’ve always felt decluttering card’s methods are just more KISS in nature. It’s also got elements of “boilerplate” now I come to think of it :-).

Anyway, I’d better leave you to it. I’ve yet to read up on the August beta.

regards and best wishes,

Hammy

@RomRider
Copy link
Collaborator

RomRider commented Aug 6, 2024

I'll review that asap but not before mid-august

@smitt04
Copy link

smitt04 commented Aug 7, 2024

Just tested out your fork and that is really sweet, great job.

It seems that editMode was recently renamed to preview in the front end:
home-assistant/frontend#21065

Rearranged the logic to toggle the hidden state to track the state
of preview as it changes.
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.

5 participants