async def METHOD_NAME():
    # Add includes at the very end, so that they override everything
    initial_states: list[PinInitialState] = CORE.data[KEY_ESP8266][
        KEY_PIN_INITIAL_STATES
    ]
    initial_modes_s = ", ".join(str(x.mode) for x in initial_states)
    initial_levels_s = ", ".join(str(x.level) for x in initial_states)
    cg.add_global(
        cg.RawExpression(
            f"const uint8_t ESPHOME_ESP8266_GPIO_INITIAL_MODE[16] = {{{initial_modes_s}}}"
        )
    )
    cg.add_global(
        cg.RawExpression(
            f"const uint8_t ESPHOME_ESP8266_GPIO_INITIAL_LEVEL[16] = {{{initial_levels_s}}}"
        )
    )