android icon indicating copy to clipboard operation
android copied to clipboard

Create strongly typed enity class for well known entity

Open TimoPtr opened this issue 9 months ago • 0 comments

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 avatar May 20 '25 13:05 TimoPtr