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

Implement entity_category #193

Merged
merged 1 commit into from
Jan 18, 2025
Merged

Conversation

TheSimpleZ
Copy link
Contributor

@TheSimpleZ TheSimpleZ commented Jan 18, 2025

This adds support for entity_category. Now you can separate entities into a diagnostics and config category.
I implemented it in my fork since it allows me to separate all the Error_f* sensors into a diagnostics category for less clutter.
I thought it might be interesting for others.
I hope you don't mind the formatting changes that went along with it. It's VScodes auto-formatting for Python. If you have some auto-formatter that I could run, I wouldn't mind using your style.

Example usage:

- property: Error_f54
    icon: mdi:dishwasher-alert
    hide: true
    entity_category: diagnostic

@oyvindwe
Copy link
Owner

Thank you very much for your contribution! ❤️

Do you know what "non-primary entity" refers to in the documentation for entity_category?

Good to fix the formatting. I've been thinking of adding black and pylint to the toolchain. Which tool(s)/formatting rules did you use?

@oyvindwe oyvindwe merged commit 457bfe0 into oyvindwe:main Jan 18, 2025
1 check passed
@TheSimpleZ
Copy link
Contributor Author

No worries :)

Unless I'm mistaken, a "non-primary entity" is simply an entity that will not show up in the auto-generated dashboard. But the only reference to it I could find is a random forum post here so I'm not dead certain that's all it does.

It might even be a nice thing to make all unmapped entities a diagnostic entity by default rather than hiding them so they don't clutter up all the mapped ones. If you are fine with such a change, I'd be happy to make a PR for it.

I just used the default rules/settings for the python black formatter extension in vscode.
It comes bundled with the Python extension together with flake8 for linting.

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.

2 participants