Never.
Home assistant does not change your yaml. Ever.
Even if a YAML integration is imported into the GUI it is still up to you to delete the old config.
This is a good thing.
This does not preclude someone making a third party tool to do it though I guess.