RestoreEntity behavior when config entry is deleted

I’m working on an integration that uses RestoreEntity for a simple sensor entity. I noticed that when using RestoreEntity, the state is retained even if the config entry is deleted and recreated. I want the state to persist between HA restarts, but not when deleting the config entry entirely. Is there a way to make RestoreEntity delete the stored state if the config entry is deleted?