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

    @callback
    def async_add_number(data_points: tuple[BaseDpNumber, ...]) -> None:
        """Add number from Homematic(IP) Local."""
        _LOGGER.debug("ASYNC_ADD_NUMBER: Adding %i data points", len(data_points))

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

    @callback
    def async_add_hub_number(data_points: tuple[SysvarDpNumber, ...]) -> None:
        """Add sysvar number from Homematic(IP) Local."""
        _LOGGER.debug("ASYNC_ADD_HUB_NUMBER: Adding %i data points", len(data_points))

        if entities := [
            HaHomematicSysvarNumber(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.NUMBER),
            target=async_add_number,
        )
    )

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

    async_add_number(data_points=control_unit.get_new_data_points(data_point_type=BaseDpNumber))

    async_add_hub_number(data_points=control_unit.get_new_hub_data_points(data_point_type=SysvarDpNumber))
Set up the Homematic(IP) Local number platform.
custom_components/homematicip_local/number.py