How do I make ESPHome include esphome/components/template/switch in the c++ source tree please?

I have been urged to move from a customcomponent to a ‘real’ component, and its all going well, except I am struggling to get ESPHome to copy across the esphome/components/template/switch to the generated code.

I can work around it by adding an internal: component to the yaml, but trying to avoid this was why I switched to a ‘real’ component (with a python part).

I thought it would be adding to the cv.adddefine or the cg.add_global, but I havent managed to make it work.

Looking at the actual template_switch.cpp code, I cannot see how it makes the codegen include itself, but it does…

The reason im doing this is because I want my custom component to ‘swawn’ a number of switches (and numbers) that appear in homeassistant. This works great with the workaround of the dummy template switch, but I feel there is a better way… (i am directly creating the template_::TemplateSwitch in the setup() method of my component)

Can anyone help here please?
thank you,