Skip to content

Create strongly typed enity class for well known entity #5340

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

Open
TimoPtr opened this issue May 20, 2025 · 0 comments
Open

Create strongly typed enity class for well known entity #5340

TimoPtr opened this issue May 20, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@TimoPtr
Copy link
Collaborator

TimoPtr commented May 20, 2025

With the migration to Koltinx serialization we've lost the generic type on the Entity class. It was most of the time used with Any and was loosing the interest of having a generic. The only case where it was used properly was for ZoneAttributes.

We should aim to do this more to enforce some proper checks on the types on well known types. It is important that we keep a certain flexibility still because we don't know all the Entity that exist in the ecosystem of Home Assistant.

Tips: We could do something like in SocketResponse with a sealed class and a default serializer to get all the values if we are not able to detect the type of the Entity properly.

@TimoPtr TimoPtr added the enhancement New feature or request label May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant