Handle shelly device profile changes without nuking config

When a 3-phase capable shelly device switches between triphase and monophase device profiles, the entities exposed by the device all change. Rather than automatically purge the entities which are no longer provided, I would like the integration to either treat the profiles as unique devices (with only the active one enabled), or at least prompt that all the existing entities are about to get purged from the system so you have an opportunity to switch the profile back before all is lost.

The reason is this: At least with the Pro3EM shelly devices, they occasionally get into a state where they become laggy or unresponsive. Sometimes it happens because of a bad firmware update (like the 1.5.0 release last week) and sometimes there is no discernible cause. Either way, the only way to restore functionality is a factory reset. If you use the shelly in monophase mode, that reset changes it to triphase, and so all 32 entities which you may have customized are lost.

I’ve been bitten by this a couple times before and getting the config back the way it was is a very tedious process.