Switch as Light helpers permanent?

Is there a way to make these permanent?
I have situation where I test multiple firmwares for a Zigbee coordinator and many times the z2m has to be restored from backup. This leads to loss of al Light helpers and I have to recreate them in the GUI.
Is there anything to make them stay even when underlying switch get removed in MQTT?

As an alternative, this still works (from my own config). It’s now unsupported though.

light:
  - platform: switch
    name: living_room_lamp
    entity_id: switch.living_room_lamp

The more longwinded way would be to make a template light.

More details here: Switch as Light - from yaml (Change device type - switch_as_x).