No switch only "on" text on custom light component

For my custom component (Homematic) there is either they option to auto detect devices or to configure them manually in configuration.yaml. If done manually the device looks perfect in frontend. For the auto detect situation I call:
homeassistant.bootstrap.setup_component(hass, component.DOMAIN, config)

Both ways (manual and auto) create the same device but for the manual option I can see a switch which is missing in the automated approach:

Can anybody give me a hint how to get the switch there (even without my code)? Thx!

For a toggle to show, the services turn_on and turn_off need to exist for the domain.

If you want to add support for a new light, consider building a light platform instead. See docs here:

Thanks for the reply. I appreciate your support and hope it will pay off with a nice new platform soon.

Actually I created a light platform and the entity is inheriting from homeassistant.components.light.

It defines
def turn_on(self, **kwargs): and
def turn_off(self, **kwargs):

As pointed out in my post the toggle is appearing if I define the same platform via the configuration file. Also the toggle is working in this situation. So I assume the light platform ist working fine. In the ‘auto detect’ situation it does not work. For ‘auto detect’ I use pretty much the same code as in Wink based on your recommendation here.