Pattern to allow second instance of integration?

Noticed that the Abode integration only allows a single instance. If you try to add a second, it says, " Already configured. Only a single configuration possible."

Many other integrations allow multiple instances and I’m wondering if there’s a “standard pattern” for HA integrations to allow multiple instances. If it’s straight-forward, I can submit a PR for it, but don’t want to reinvent a wheel.

This decision is impacting very core of development of integration;

  • storing state data and separation of data of the same integration and different instances
  • generating unique id for each instance
  • setting up services and consuming them (integration.lock() vs integration.lock(instance) vs instance1.lock())

Any integration can be converted into multi instance supported but it requires a migration for existing users as their unique ids for existing instances should be updated respectively.