I’m currently looking at the Hive integration, and noticed that it only exposes entities, and not devices.
While this seems fine for some of the functionality, there are a lot of areas where a device seems to be necessary. For example in the conditions and actions in automations, there are a lot of options where you need to select from a list of devices - if the entity is not assiciated with a device, then there is no way to query or act on those entities.
So, I set out to see if I could change this. It would seem that there are 2 ways of creating entities…
Here’s my understanding. The first uses the platform, (in this case the Hive API) to build the set of entities on the fly. The second uses the configuration to create them. In the second model, you’d have the platform enumerate the devices/entities when the platform is configured, and then store the configuration.
However, it seems that for the
async_setup_platform, it is only possible to set up entities, and not devices. I quote from the Architecuture documentation:
“Entity device info is only read if the entity is loaded via a config entry”
So, although I have added a device_info function, it still doesn’t create the devices.
Why is this? Why can’t I associate platform-generated entities with devices? Or am I missing something?