Add the option to delete an entity data history when deleting said entity

Ref: Removing an entity does not remove its data · Issue #100762 · home-assistant/core · GitHub

Hello everyone,

I am developing my own sensors and sometimes (often) I happen to send corrupted data on HA. Because my sensors unique IDs are deterministic, they do not change over software version. Thus, when I release the stable version, I still have all the corrupted data of my previous attempts in the HA history (see image on the GitHub issue linked above).

My suggestion is to add a check box when deleting a device, that asks if we also want to delete device entities history. The default choice would be unchecked, as it is the safest. There could also be a “delete entity history” in the entity menu.