async def async_setup_entry(
    hass: HomeAssistant,
    entry: HomematicConfigEntry,
    async_add_entities: AddEntitiesCallback,
) -> None:
    """Set up the Homematic(IP) Local light platform."""
    control_unit: ControlUnit = entry.runtime_data

    @callback
    def async_add_light(data_points: tuple[CustomDpDimmer, ...]) -> None:
        """Add light from Homematic(IP) Local."""
        _LOGGER.debug("ASYNC_ADD_LIGHT: Adding %i data points", len(data_points))

        if entities := [
            HaHomematicLight(
                control_unit=control_unit,
                data_point=data_point,
            )
            for data_point in data_points
        ]:
            async_add_entities(entities)

    entry.async_on_unload(
        func=async_dispatcher_connect(
            hass=hass,
            signal=signal_new_data_point(entry_id=entry.entry_id, platform=DataPointCategory.LIGHT),
            target=async_add_light,
        )
    )

    async_add_light(data_points=control_unit.get_new_data_points(data_point_type=CustomDpDimmer))

    platform = entity_platform.async_get_current_platform()
    platform.async_register_entity_service(
        HmipLocalServices.LIGHT_SET_ON_TIME,
        {
            vol.Required(ATTR_ON_TIME): vol.All(vol.Coerce(int), vol.Range(min=-1, max=8580000)),
        },
        "async_set_on_time",
    )
Set up the Homematic(IP) Local light platform.
custom_components/homematicip_local/light.py