home-assistant / architecture

Repo to discuss Home Assistant architecture
317 stars 99 forks source link

Require platform and entity info in manifest #293

Closed isabellaalstrom closed 1 year ago

isabellaalstrom commented 5 years ago

Context

When looking at an integration on the integrations page it's sometimes hard to gather what kind of platforms, entities and services will be available in Home Assistant. Example: Withings integration, will I be able to see the battery status of my devices? What sensors am I going to get?

Proposal

Consequences

This will allow for the documentation to sync this information in the future, and also keeping the information in one place, close to the actual code, makes it easier to update when an integration updates. While allowing the frontend to show it on the integration as well.

balloob commented 5 years ago

How would this data be structured and used when stored in the manifest ? Is this something that we just want in teh documentation text ?

isabellaalstrom commented 5 years ago

Documentation text and also in the integrations panel inside ha?

isabellaalstrom commented 5 years ago

Another option is of course to make this a part of a template for how you are supposed to write the documentation. But then you can't easily pull in the data to integrations as well?

NeLLyMerC commented 5 years ago

This is something I've wanted to contribute for a few years, although I'm still not sure what will work best. To start, what if there were just a heading for "Entities" like there is now for Configuration and Services where applicable. Below it could be a table or image of each entity an integration would add and the value description/type of each. That would give the user an idea of what data an integration would give them access to. I will try to mock up an example and attach it to this thread.

Adminiuga commented 5 years ago

Isn't integration documentation page a better place for this kind of information?

isabellaalstrom commented 5 years ago

The point is for the documentation to pull in this information from the manifest. This way we get one source of truth, close to the code where changes is going to happen. It's also possible to get the integrations page in Home assistant to pull in the info from the manifest, so that it's shown on this page. image Again to have one source of truth and also keeping DRY.

isabellaalstrom commented 5 years ago

@NeLLyMerC Yes, that is what I've thought about for showing it as well, only that the information it self comes from the manifest. Change it there and docs will update accordingly. The most important part is that the information should be there, and having it in the manifest is just an idea to keep everything together, and also allow for code reviewers that have checked the code to review this as well to keep it updated.

pvizeli commented 5 years ago

How would this data be structured and used when stored in the manifest ?

Make an example Isabella

isabellaalstrom commented 5 years ago

Basic example for a miflora device (the first thing I could think of). Added binary sensors also for more context. Something like this maybe? Or maybe there need to be a short description attached to each entity as well.


{
  "domain": "your_domain_name",
  [other manifest data],
  "entities" : 
    [
      "sensors":
        [
          "battery",
          "conductivity",
          "moisture",
          "light_intensity",
          "temperature"
        ],
      "binary_sensors":
        [...]
    ]
}
isabellaalstrom commented 5 years ago

Or maybe it needs to be it's own file and not be in the manifest, for brevity.

frenck commented 1 year ago

This architecture issue is old, stale, and possibly obsolete. Things changed a lot over the years. Additionally, we have been moving to discussions for these architectural discussions.

For that reason, I'm going to close this issue.

../Frenck